UNSAFE_componentWillMount() { const ctx = this.context.incrementalGroup; if (!ctx) { return; } this._incrementId = ++ctx.incrementalCount; InteractionManager.runAfterInteractions({ name: 'Incremental:' + this.getName(), gen: () => new Promise(resolve => { if (!this._mounted || this._rendered) { resolve(); return; } DEBUG && infoLog('set doIncrementalRender for ' + this.getName()); this.setState({doIncrementalRender: true}, resolve); }), }) .then(() => { DEBUG && infoLog('call onDone for ' + this.getName()); this._mounted && this.props.onDone && this.props.onDone(); }) .catch(ex => { ex.message = `Incremental render failed for ${this.getName()}: ${ ex.message }`; throw ex; }) .done(); }
success: (result) => { InteractionManager.runAfterInteractions(() => { dispatch(({type: REMOVED_FOLLOWS, result, row})); }); },
const timeoutHandle = setTimeout(() => { this._taskHandle = InteractionManager.runAfterInteractions(() => { // Note that we clear the handle before invoking the callback so that if the callback calls // schedule again, it will actually schedule another task. this._taskHandle = null; this._callback(); }); }, this._delay);
runAfterInteractions: function(callback: Function) { InteractionManager.runAfterInteractions(callback); },
componentDidMount() { this._isMounted = true; InteractionManager.runAfterInteractions(() => { this._isMounted && this.setState({loaded: true}); }); }