improve docs re: redraw
This commit is contained in:
parent
82ebff4336
commit
1d8021500a
2 changed files with 4 additions and 2 deletions
|
|
@ -14,6 +14,8 @@ You DON'T need to call it if data is modified within the execution context of an
|
|||
|
||||
You DO need to call it in `setTimeout`/`setInterval`/`requestAnimationFrame` callbacks, or callbacks from 3rd party libraries.
|
||||
|
||||
Typically, `m.redraw` triggers an asynchronous redraws, but it may trigger synchronously if Mithril detects it's possible to improves performance by doing so. You should write code assuming that it always redraws asynchronously.
|
||||
|
||||
---
|
||||
|
||||
### Signature
|
||||
|
|
@ -32,4 +34,4 @@ When callbacks outside of Mithril run, you need to notify Mithril's rendering en
|
|||
|
||||
To trigger a redraw, call `m.redraw()`. Note that `m.redraw` only works if you used `m.mount` or `m.route`. If you rendered via `m.render`, you should use `m.render` to redraw.
|
||||
|
||||
You should not call m.redraw from a [lifecycle method](lifecycle-methods.md). Doing so will result in undefined behavior.
|
||||
You should not call m.redraw from a [lifecycle method](lifecycle-methods.md). Doing so will result in undefined behavior.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue