Skip to content

Latest commit

 

History

History
21 lines (14 loc) · 453 Bytes

no-single-composition.md

File metadata and controls

21 lines (14 loc) · 453 Bytes

Enforce at least two methods arguments for composition methods

Giving one argument to composition methods like _.flow and _.compose is useless, as _.flow(fn)(x) is the same as calling fn(x).

Fail

import _, {flow} from 'lodash/fp';

flow(fn)(x);
_.flow(fn)(x);

Pass

import _, {flow} from 'lodash/fp';

flow(fn1, fn2)(x);
_.flow(fn1, fn2)(x);