featurist/plastiq — pull request #4 by joshski (2014-12-31 12:43:10+00:00)
Title: Onattach

This adds support for `onattach` handlers, which will fire once after the first render, then trigger a dom refresh. Ideally it might fire *before* the first render, but the motivation for this is to render a "loading" screen while some async operation completes, so delaying the first render would defeat the purpose.

This implementation uses virtual-dom widgets. I don't think this is exactly what widgets are for, but I'm not sure how else to avoid re-executing the handler when the dom is patched. The answer doesn't appear to be in virtual-dom hooks, not yet anyway.

@refractalize if you're happy with this direction then I'll add some docs.