React Native: Fix InteractionManager Race Condition

This commit is contained in:
Tim Yung 2015-04-13 11:19:28 -07:00
Родитель db45ed4a53
Коммит 29696a26eb
1 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -119,6 +119,8 @@ function scheduleUpdate() {
* Notify listeners, process queue, etc
*/
function processUpdate() {
_nextUpdateHandle = null;
var interactionCount = _interactionSet.size;
_addInteractionSet.forEach(handle =>
_interactionSet.add(handle)
@ -138,12 +140,13 @@ function processUpdate() {
// process the queue regardless of a transition
if (nextInteractionCount === 0) {
_queue.forEach(callback => {
var queue = _queue;
_queue = [];
queue.forEach(callback => {
ErrorUtils.applyWithGuard(callback);
});
_queue = [];
}
_nextUpdateHandle = null;
_addInteractionSet.clear();
_deleteInteractionSet.clear();
}