0.0.1 • Published 7 years ago

fluent-compose v0.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

fluent-compose

npm package Coveralls

#fluent-compose

More documentation needed.

import * as zaphod from 'zaphod/compat';
import * as lodashFpCollection from 'lodash/fp/collection';
import { threadFirst, threadLast, fluentCompose } from 'fluent-compose';

const zaphodTransform = threadFirst(zaphod);
const lodashTransform = threadLast(lodashFpCollection);

const transform = fluentCompose({
  ...zaphodTransform,
  ...lodashTransform,
})

const transformer = transform
  .map(x => x + 2)
  .filter(x => x % 2)
  .set(0, 3)

transformer([1,2,3,4]) // [3, 6]
0.0.1

7 years ago