Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split up createTimer into two methods, createTimer and createTimerFor…
…NextFrame Summary: This diff adds nuance to timer creation. Imagine the following bit of JS: ``` setTimeout(() => { console.log("Timeout") }, 0); setImmediate(() => { setNine("Immediate"); }); ``` In classic RN, `setTimeout` will be called async by the bridge, immediate is implemented in JS, so the ordering of logs will be: 1. Immediate 2. Timeout In bridgeless RN `setTimeout` is called sync, so the ordering of the logs is: 1. Timeout 2. Immediate In order to preserve ordering, this diff adds a timer creation method which doesn't immediately invoke it, but waits one frame to do so. This PR does the same thing for android, and explains the reasoning for preserving behaviour (some products may rely on this behaviour) f054928 Reviewed By: ejanzer Differential Revision: D17535639 fbshipit-source-id: 3f734c420a6a95be2ee10e8d6ac48adc79ef1c96
- Loading branch information