Skip to content

Commit ff7422b

Browse files
committed
use curry instead of fp/curryN to be compatible with lodash-es
1 parent 0fa1733 commit ff7422b

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/createCurriedAction.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import curryN from 'lodash/fp/curryN';
1+
import curry from 'lodash/curry';
22
import createAction from './createAction';
33

44
export default (type, payloadCreator) =>
5-
curryN(payloadCreator.length, createAction(type, payloadCreator));
5+
curry(createAction(type, payloadCreator), payloadCreator.length);

test/createCurriedAction.test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import createCurriedAction from '../src/createCurriedAction';
2+
3+
const type = 'TYPE';
4+
5+
test('returns curried function', () => {
6+
const curriedAction = createCurriedAction(type, (a, b) => a + b);
7+
8+
const a = curriedAction(1);
9+
const b = a(2);
10+
11+
expect(b).toEqual({ payload: 3, type });
12+
});

0 commit comments

Comments
 (0)