Skip to content

Commit 82cbc97

Browse files
committed
Added support for custom selectors
1 parent 3f2b460 commit 82cbc97

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/createReduxModule.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const createReduxModule = (storeKey, initialState, reducers, store = getStore())
2727
);
2828

2929
return [
30-
() => useSelector(storeState => storeState[storeKey]),
30+
(fn = null) => useSelector(storeState => { return typeof fn === 'function' ? fn(storeState[storeKey]) : storeState[storeKey] }),
3131
mapKeys(reducers, type => payload => store.dispatch({ type: getQualifiedActionType(type), payload })),
3232
createVirtualStore(store, storeKey)
3333
];

0 commit comments

Comments
 (0)