improve docs

This commit is contained in:
Leo Horie 2014-09-14 00:22:00 -04:00
parent 81fc994954
commit 8c3467b819
10 changed files with 171 additions and 9 deletions

View file

@ -1,5 +1,13 @@
## m.module
---
[Usage](#usage)
[Unloading modules](#unloading-modules)
[Signature](#signature)
---
A module is an Object with two keys: `controller` and `view`. Each of those should point to a Javascript function.
When using `m.module`, Mithril instantiates controllers as if they were class constructors. However, controllers may return objects if you want to use that Javascript feature to have more fine-grained control over a controller's lifecycle.