Skip to content

Commit

Permalink
Add a comment in the code
Browse files Browse the repository at this point in the history
Add a comment to clarify why we explicitly bind the functions to window.
  • Loading branch information
liady authored Sep 10, 2019
1 parent 5c6b97d commit 2dc1147
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/scheduler/src/forks/SchedulerHostConfig.default.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ if (
const Date = window.Date;
const setTimeout = window.setTimeout;
const clearTimeout = window.clearTimeout;
// Explicitly bind local references to `window`, in order to support
// environments where the global `this` is not the window (e.g extensions)
const requestAnimationFrame =
window.requestAnimationFrame && window.requestAnimationFrame.bind(window);
const cancelAnimationFrame =
Expand Down

0 comments on commit 2dc1147

Please sign in to comment.