diff --git a/src/reanimated2/initializers.ts b/src/reanimated2/initializers.ts index ce98e07946f..2c8279329a0 100644 --- a/src/reanimated2/initializers.ts +++ b/src/reanimated2/initializers.ts @@ -128,7 +128,7 @@ function setupRequestAnimationFrame() { global.__frameTimestamp = undefined; }); } - // Reanimated currently does not support cancelling calbacks requested with + // Reanimated currently does not support cancelling callbacks requested with // requestAnimationFrame. We return -1 as identifier which isn't in line // with the spec but it should give users better clue in case they actually // attempt to store the value returned from rAF and use it for cancelling. diff --git a/src/reanimated2/threads.ts b/src/reanimated2/threads.ts index 984b851e5d7..00d5dfcc847 100644 --- a/src/reanimated2/threads.ts +++ b/src/reanimated2/threads.ts @@ -13,20 +13,20 @@ let _runOnUIQueue: Array<[ComplexWorkletFunction, any[]]> = []; export function setupSetImmediate() { 'worklet'; - let immediateCalbacks: Array<() => void> = []; + let immediateCallbacks: Array<() => void> = []; // @ts-ignore – typescript expects this to conform to NodeJS definition and expects the return value to be NodeJS.Immediate which is an object and not a number global.setImmediate = (callback: () => void): number => { - immediateCalbacks.push(callback); + immediateCallbacks.push(callback); return -1; }; global.__flushImmediates = () => { - for (let index = 0; index < immediateCalbacks.length; index += 1) { + for (let index = 0; index < immediateCallbacks.length; index += 1) { // we use classic 'for' loop because the size of the currentTasks array may change while executing some of the callbacks due to setImmediate calls - immediateCalbacks[index](); + immediateCallbacks[index](); } - immediateCalbacks = []; + immediateCallbacks = []; }; }