0.1.3 • Published 1 year ago

@jondotsoy/decorate v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

decorate

Example:

type A = DescriptorSync<[number], number>;

const increaseBy1: DecoratorSync<A> = (descriptor) => (n: number) =>
  descriptor(n + 1);
const increaseBy2: DecoratorSync<A> = (descriptor) => (n: number) =>
  descriptor(n + 2);
const increaseBy3: DecoratorSync<A> = (descriptor) => (n: number) =>
  descriptor(n + 3);

const increase = decorateSync(
  (n: number) => n,
  increaseBy1,
  increaseBy2,
  increaseBy3,
);
expect(increase(1)).toEqual(7);
0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago