Пример #1
0
 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();
 }
Пример #2
0
      success: (result) => {

        InteractionManager.runAfterInteractions(() => {
          dispatch(({type: REMOVED_FOLLOWS, result, row}));
        });

      },
Пример #3
0
 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);
Пример #4
0
 runAfterInteractions: function(callback: Function) {
   InteractionManager.runAfterInteractions(callback);
 },
Пример #5
0
 componentDidMount() {
   this._isMounted = true;
   InteractionManager.runAfterInteractions(() => {
     this._isMounted && this.setState({loaded: true});
   });
 }