Skip to content

Instantly share code, notes, and snippets.

@funkjunky
Created February 5, 2018 04:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save funkjunky/e147c09e81b80123e0a596563e320a36 to your computer and use it in GitHub Desktop.
Save funkjunky/e147c09e81b80123e0a596563e320a36 to your computer and use it in GitHub Desktop.
if(module.hot) {
module.hot.accept(() => {
window.store.replaceReducer(reducer)
window.cancelAnimationFrame(window.raf);
window.raf = window.requestAnimationFrame(step)
});
}
function step(dt) {
graphics(window.ctx, window.store.getState(), dt);
window.requestAnimationFrame(step);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment