MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / commitCallbacks

Function commitCallbacks

code/one-direction-data-flow/public/app.js:8003–8019  ·  view source on GitHub ↗
(queue, context)

Source from the content-addressed store, hash-verified

8001}
8002
8003function commitCallbacks(queue, context) {
8004 var callbackList = queue.callbackList;
8005 if (callbackList === null) {
8006 return;
8007 }
8008 // Set the list to null to make sure they don't get called more than once.
8009 queue.callbackList = null;
8010 for (var i = 0; i < callbackList.length; i++) {
8011 var update = callbackList[i];
8012 var _callback = update.callback;
8013 // This update might be processed again. Clear the callback so it's only
8014 // called once.
8015 update.callback = null;
8016 !(typeof _callback === 'function') ? invariant(false, 'Invalid argument passed as callback. Expected a function. Instead received: %s', _callback) : void 0;
8017 _callback.call(context);
8018 }
8019}
8020
8021var fakeInternalInstance = {};
8022var isArray = Array.isArray;

Callers 1

commitLifeCyclesFunction · 0.70

Calls 1

invariantFunction · 0.70

Tested by

no test coverage detected