Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Use window.requestAnimationFrame() instead of timeouts #174

Closed
slaweet opened this issue May 4, 2017 · 0 comments
Closed

Use window.requestAnimationFrame() instead of timeouts #174

slaweet opened this issue May 4, 2017 · 0 comments

Comments

@slaweet
Copy link
Contributor

slaweet commented May 4, 2017

Actual behaviour

We are setting timeouts (usually 20 seconds) in various components to re-check for things like:

  • latest transactions
  • account balance
  • delegates
  • votes

Expected behaviour

As @alihaghighatkhah pointed out, we should be using window.requestAnimationFrame() because it triggers only when the window is visible, so it can save a lot of traffic.
Although, we must implement a function that determines whether it makes sense to repeat a particular request. It would be nice if it could somehow synchronise with block time so that it knows that a new block has been forged and thus there can potentially be some changes.

Maybe we can use this angular wrapper:
https://www.npmjs.com/package/angular-raf

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants