From 665c2089a459289fe815eebde82fc2606731c39d Mon Sep 17 00:00:00 2001 From: Leo Horie Date: Mon, 21 Jul 2014 22:16:48 -0400 Subject: [PATCH] fix docs --- docs/mithril.module.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/mithril.module.md b/docs/mithril.module.md index 9f733147..d76f76a0 100644 --- a/docs/mithril.module.md +++ b/docs/mithril.module.md @@ -1,8 +1,8 @@ ## m.module -A module is an Object with two keys: `controller` and `view`. Each of those should point to a Javascript class constructor function. +A module is an Object with two keys: `controller` and `view`. Each of those should point to a Javascript function. -'m.module' activates a module by instantiating its controller, then instantiating its view and rendering it into a root DOM element. +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. Conceptually, the easiest way to think of a module is as a logical namespace with which to organize applications. For example, an app might have a dashboard module, a userEditForm module, an autocompleter module, a date formatting module, etc