function unbatchedUpdates(fn, a) { //非常有趣的设计,类似锁、释放内存的设计 var prevExecutionContext = executionContext; //0 executionContext &= ~BatchedContext; //1 executionContext |= LegacyUnbatchedContext; //8 try { return fn(a); //执行updateContainer.... } finally { executionContext = prevExecutionContext; //重置.... if (executionContext === NoContext) { // Flush the immediate callbacks that were scheduled during this batch resetRenderTimer(); flushSyncCallbackQueue(); } } }
原文:https://www.cnblogs.com/allenliu0927/p/14979622.html