-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
I'm using redux-subscribe with plain redux (no react, no vdux or whatever).
Since I'm a redux beginner, I don't understand this line of your code:
Index: node_modules/redux-subscribe/lib/index.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- node_modules/redux-subscribe/lib/index.js (revision )
+++ node_modules/redux-subscribe/lib/index.js (revision )
@@ -85,6 +85,7 @@
if (prev !== next) {
(0, _foreach2.default)(function (fn) {
+ // Why is the return value of fn dispatched again?
return dispatch(fn({ path: path, prev: prev, next: next }));
}, subscriptions[path]);
}My call to subscribe looks like this:
store.dispatch(subscribe('feature', 'feature', () => {
renderFeature();
return {type: null};
}));But initially I tried doing:
store.dispatch(subscribe('feature', 'feature', renderFeature));...which failed as the dispatch function is passed a null and cannot find a property type on it. As a result I return {type: null} from my wrapped render function. Am I doing something wrong?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels