Skip to content

Commit

Permalink
bind this for plugin reducer/render
Browse files Browse the repository at this point in the history
  • Loading branch information
sheppard committed Aug 29, 2019
1 parent 736af13 commit e94ebd6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/app/src/app.js
Expand Up @@ -75,10 +75,12 @@ app.init = function(config) {
config.store.ajax = plugin.ajax;
}
if (plugin.reducer) {
ds.addReducer(name, plugin.reducer);
ds.addReducer(name, (state, action) =>
plugin.reducer(state, action)
);
}
if (plugin.render) {
router.addRender(plugin.render);
router.addRender(state => plugin.render(state));
}
if (plugin.actions) {
Object.assign(plugin, ds.bindActionCreators(plugin.actions));
Expand Down

0 comments on commit e94ebd6

Please sign in to comment.