Simplify mounting to just be sugar over m.render
#2280
Labels
Type: Breaking Change
For any feature request or suggestion that could reasonably break existing code
Type: Enhancement
For any feature request or suggestion that isn't a bug fix
Updates
onevent
callback per-call form.redraw
#2074.e.redraw
in favor of theupdate
callback in Simplify our component model #2295.This is part 3 of a broader proposal: #2278.
This is the second major step of how Mithril would become a lot more component-driven and less component-oriented. My goal here would be to further encourage component use over definition, by changing
m.mount
/m.redraw
to accept a view function to invoke on each redraw, rather than a component to render. This has a few benefits:m.render
.There are a few other things I'd do:
onevent
callback per-call form.redraw
#2074 to simplify mountingm.mount
andm.redraw
for some size gains.e.redraw
in favor of theupdate
callback in Simplify our component model #2295. (I'd do similar form.request
.)Here's what the mounting and redrawing would change to.
I'd consolidate
m.redraw
andm.mount
into a single file as per below.I do have a few notes:
render
is passed via parameter instead of directly instantiatedVnode
, so it's a little more portable and better decoupled.The text was updated successfully, but these errors were encountered: