Skip to content

Commit

Permalink
variadic args for dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ellbee committed Aug 27, 2015
1 parent 29693f6 commit 31a30bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Expand Up @@ -22,8 +22,8 @@ export function createSelectorCreator(memoize, ...memoizeOptions) {
const memoizedResultFunc = memoize(selectors.pop(), ...memoizeOptions);
const dependencies = Array.isArray(selectors[0]) ?
selectors[0] : selectors;
return (state, props) => {
const params = dependencies.map(dependency => dependency(state, props));
return (...args) => {
const params = dependencies.map(dependency => dependency(...args));
return memoizedResultFunc(...params);
};
};
Expand Down

0 comments on commit 31a30bd

Please sign in to comment.