Add support for (m.mount + m.route) × (factory + constructible) components

This commit is contained in:
Pierre-Yves Gerardy 2017-02-15 21:58:10 +01:00
parent f4fb5ac4be
commit f273b012c9
2 changed files with 4 additions and 3 deletions

View file

@ -10,7 +10,7 @@ module.exports = function(redrawService) {
return
}
if (component.view == null) throw new Error("m.mount(element, component) expects a component, not a vnode")
if (component.view == null && typeof component !== "function") throw new Error("m.mount(element, component) expects a component, not a vnode")
var run = function() {
redrawService.render(root, Vnode(component))