Skip to content

Commit

Permalink
Merge branch 'release/v0.6.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
raulmatei committed May 25, 2016
2 parents 7d56b09 + 51c5ad5 commit 461f1bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "frux",
"version": "0.6.1",
"version": "0.6.2",
"description": "Simple wrapper over NuclearJS flux implementation",
"main": "./dist/frux.js",
"author": "Raul Matei",
Expand Down
4 changes: 3 additions & 1 deletion src/create-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ import isArray from 'lodash/isArray';
import isFunction from 'lodash/isFunction';

export default function createModule({ stores, actions, getters }) {
const looksLikeGetter = (value) => isFunction(value) || isArray(value);

return (name, target, reactor) => {
if (!isEmpty(stores)) {
reactor.registerStores(stores);
}

target.actions[name] = pickBy(actions, isFunction);
target.getters[name] = pickBy(getters, isArray);
target.getters[name] = pickBy(getters, looksLikeGetter);
};
}

0 comments on commit 461f1bf

Please sign in to comment.