small tweaks to docs

This commit is contained in:
Leo Horie 2016-12-01 01:49:19 -05:00
parent c5c18f9231
commit 87dcbbf5c7
19 changed files with 308 additions and 75 deletions

View file

@ -1,11 +1,11 @@
# redraw()
- [API](#api)
- [Signature](#signature)
- [How it works](#how-it-works)
---
### API
### Signature
`m.redraw()`
@ -19,6 +19,6 @@ Argument | Type | Required | Description
When callbacks outside of Mithril run, you need to notify Mithril's rendering engine that a redraw is needed. External callbacks could be `setTimeout`/`setInterval`/`requestAnimationFrame` callbacks, web socket library callbacks, event handlers in jQuery plugins, third party XHR request callbacks, etc.
To trigger a redraw, call `m.redraw()`
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.