Created
March 10, 2016 11:37
-
-
Save maxidr/e4a042496b6be8457aeb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void function(m) { | |
function closure(fn) { | |
var component = { | |
controller : function(options) { | |
component.view = fn(options); | |
} | |
}; | |
return component; | |
} | |
m.mount(document.body, closure(function() { | |
var count = 1; | |
function increment() { | |
count++; | |
} | |
return function() { | |
return m("div", | |
count, | |
m("button", | |
{ onclick : increment }, | |
"increment" | |
) | |
); | |
} | |
})); | |
}(m) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment