Created
April 29, 2015 22:16
-
-
Save pelonpelon/bd07b3b76ce70b580639 to your computer and use it in GitHub Desktop.
Mithril component inheritance - credit: Gilbert (https://github.com/mindeavor)
This file contains 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
m.initComponent = function (component, options, content) { | |
var controller = new component.controller(options) | |
controller.render = function (options2, content2) { | |
return component.view(controller, options2 || options, content2 || content) | |
} | |
return controller | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment