refactor redraw into pubsub and autoredraw
- pubsub is a basic pubsub impl - autoredraw is glue code to register callback to pubsub and onevent moved e.redraw to autoredraw
This commit is contained in:
parent
db46bb4414
commit
0005cf26ee
13 changed files with 149 additions and 105 deletions
|
|
@ -7,7 +7,6 @@ module.exports = function(callback) {
|
|||
var timeout = typeof requestAnimationFrame === "function" ? requestAnimationFrame : setTimeout
|
||||
return function(synchronous) {
|
||||
var now = new Date().getTime()
|
||||
if (typeof synchronous === "object" && "redraw" in synchronous && !synchronous.redraw) return
|
||||
if (synchronous === true || last === 0 || now - last >= time) {
|
||||
last = now
|
||||
callback()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue