Merge pull request #1036 from tivac/lifecycle-states

Added lifecycle method descriptions
This commit is contained in:
Leo Horie 2016-05-04 14:28:16 -04:00
commit a61be6f41d

View file

@ -18,6 +18,12 @@ Mithril's virtual DOM engine is now less than 400 lines of well organized code a
Mithril's `config` method is now replaced by several lifecycle methods to improve separation of concerns and allow better control over animations.
- **`oninit`** Run once before vnode creation
- **`oncreate`** Run after the DOM element is created
- **`onupdate`** Run after vnode is diffed
- **`onremove`** Run before DOM removal
- **`onbeforeremove`** Run before DOM removal
## Robustness
There are over 1800 assertions in the test suite, and tests cover even difficult-to-test things like `location.href`, `element.innerHTML` and `XMLHttpRequest` usage.