It's a common question on Gitter: How do I unmount a component?
Presently this Google Search: `unmount site:http://lhorie.github.io/`
returns one result: `mithril.route.html` -- I have no idea why, there's no "unmount" on the page.
Adding the words unmounting and unmount to this doc page will make them discoverable directly and through Google.
These changes make the the text clearer to me. I did not want to change the voice of the text, but I tried to clear out some verbosity and improve consistency. I did my best not to interfere with the logic of the prose.
This document seems written to stand on its own, so I recommend the following changes:
- a general explanation of the args param as in `controller: function(args) {` and `view: function(ctrl, args) { ...` (when first used, well before the signature)
- a specific explanation of {data: args} in m.request() (mithril.request.md could use the same treatment)
- an explanation of the extras param as in `controller: function(args, extras) {` and `view: function(ctrl, args, extras) { ...`
- the term *rollback* should be explained or replaced
- caveat #3/#4: Should *root element* be changed to *top-most element* so as not to be confused with the element the component is mounted on ?
- in testing, explain why the first param to view is `null`
I hope you can find some of this useful.
- The term *rollback* should be explained or replaced
- caveat #3/#4: Should *root element* be changed to *top-most element* so as not to be confused with the element the component is mounted on ?
These changes make the the text clearer to me. I did not want to change the voice of the text, but I tried to clear out some verbosity and improve consistency. I did my best not to interfere with the logic of the prose.
This document seems written to stand on its own, so I recommend the following additions:
- a general explanation of the args param as in `controller: function(args) {` and `view: function(ctrl, args) { ...`
- a specific explanation of how {data: args} in m.request() becomes url parameters (mithril.request.md could use the same treatment)
- an explanation of the extras param as in `controller: function(args, extras) {` and `view: function(ctrl, args, extras) { ...`