reactjs - Uncaught Error: Invariant Violation: FluxStore has not overridden FluxStore.__onDispatch(), which is required -
this code store:
var store = require("flux/utils").store; var apiutil = require("../util/api_util"); var appdispatcher = require('../dispatcher/dispatcher'); var _users = apiutil.getusers() || []; var change_event = "change"; var userstore = new store(appdispatcher); userstore._ondispatch = function(payload){ switch(payload.actiontype){ case userconstants.users_received: console.log(payload); userstore.changed(); break; } };
i'm getting error mentioned in title (viz. "uncaught error: invariant violation: fluxstore has not overridden fluxstore.__ondispatch(), required") when apiactions method hits this:
appdispatcher.dispatch({ actiontype: userconstants.users_received, users: users });
i have added fluxstore overwrite _ondispatch method requested, still getting error. overwriting incorrectly?
any appreciated.
fluxstore.__ondispatch() has 2 __
and have defined userstore._ondispatch instead of userstore.__ondispatch
Comments
Post a Comment