Skip to content

Commit 84b8c4c

Browse files
committed
bugfix: remove globalThis references
1 parent 3a89d52 commit 84b8c4c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/requestReversibleAnimationFrame.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* @returns callback to cancel action
55
*/
66
function requestReversibleAnimationFrame(...args: Parameters<typeof requestAnimationFrame>): () => void {
7-
const ref = window.requestAnimationFrame(...args);
8-
return window.cancelAnimationFrame.bind(window, ref);
7+
const ref = requestAnimationFrame(...args);
8+
return cancelAnimationFrame.bind(window, ref);
99
}
1010

1111
export default requestReversibleAnimationFrame;

src/setReversibleInterval.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* @returns callback to stop interval
66
*/
77
function setReversibleInterval(...args: Parameters<typeof setInterval>): () => void {
8-
const ref = global.setInterval(...args);
9-
return global.clearInterval.bind(global, ref); // interval-IDs are unique and never reused. multiple calls to clear with the same ID will have no effect.
8+
const ref = setInterval(...args);
9+
return clearInterval.bind(global, ref); // interval-IDs are unique and never reused. multiple calls to clear with the same ID will have no effect.
1010
}
1111

1212
export default setReversibleInterval;

src/setReversibleTimeout.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* @returns callback to cancel timeout
66
*/
77
function setReversibleTimeout(...args: Parameters<typeof setTimeout>): () => void {
8-
const ref = global.setTimeout(...args);
9-
return global.clearTimeout.bind(global, ref); // timeout-IDs are unique and never reused. multiple calls to clear with the same ID will have no effect.
8+
const ref = setTimeout(...args);
9+
return clearTimeout.bind(global, ref); // timeout-IDs are unique and never reused. multiple calls to clear with the same ID will have no effect.
1010
}
1111

1212
export default setReversibleTimeout;

0 commit comments

Comments
 (0)