Support for skipping redraws (#1049)
Mostly useful for event handlers, setting `e.redraw = false` will prevent mithril from re-rendering.
This commit is contained in:
parent
2ca8fa6e66
commit
04eaa25ab1
4 changed files with 76 additions and 1 deletions
|
|
@ -81,4 +81,12 @@ o.spec("throttle", function() {
|
|||
|
||||
o(spy.callCount).equals(2)
|
||||
})
|
||||
})
|
||||
|
||||
o("it supports aborting when redraw is falsey", function() {
|
||||
throttled({ redraw : false })
|
||||
throttled({ redraw : 0 })
|
||||
throttled({ redraw : "" })
|
||||
|
||||
o(spy.callCount).equals(0)
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue