From b6c2f705266d7ee2ff81b57d43c839670bd257f0 Mon Sep 17 00:00:00 2001 From: Leo Horie Date: Mon, 30 Mar 2015 10:55:34 -0400 Subject: [PATCH] add missing return --- docs/mithril.render.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/mithril.render.md b/docs/mithril.render.md index c887cff5..0b4c6beb 100644 --- a/docs/mithril.render.md +++ b/docs/mithril.render.md @@ -60,7 +60,7 @@ This mechanism is only intended to be used as a last resort optimization tool. I The example below shows how to use a SubtreeDirective object to create a static header that doesn't incur diff costs once it has been rendered. This means that we are avoiding the creation of the header subtree (and therefore skipping the diff algorithm) altogether, but it also means that dynamic variables will NOT be updated within the header. -``` +```javascript var app = {} //here's an example plugin that determines whether data has changes. @@ -78,7 +78,7 @@ app.bindOnce = (function() { //here's the view app.view = function() { - m(".layout", [ + return m(".layout", [ app.bindOnce(function() { //this only runs once in order to boost performance //dynamic variables are not updated here