reactjs – React Redux源函数ensureCanMutateNextListeners?
如何理解函数ensureCanMutateNextListeners?
https://github.com/reactjs/redux/blob/master/src/createStore.js 解决方法
发布从
Aaron Powell’s blog post here获得的相关部分
来自redux的订阅函数的示例实现 let subscriptions = []; const subscribe = function (fn) { if (typeof fn !== 'function') { throw Error('The provided listener must be a function'); } var subscribed = true; // This line is what we are interested in subscriptions.push(fn); return function () { if (!subscribed) { return; } var index = subscriptions.indexOf(fn); subscriptions.splice(index,1); subscribed = false; }; }; 对于每次执行的调度,我们必须通知每个订户. 来自博客
继续 …
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |