onload / onunload events
kristoferjoseph opened this issue · comments
@shama How do you need to write yo-yo components to take advantage of bel's onload / unload behavior?
We're waiting for a new morphdom
release to add support for this; I created a lil playground to show off how to create stateful components with morphdom
✨ - we should probably create a nice lil wrapper that can memoize based on arguments at some point, but hope the repo can provide some help for now - cheers! ✌️
See Also
Nice! I'm down to write a wrapper. Did you link to the playground you wrote?
Did some more experiments and load
/unload
work currently, but not for cached elements, that was my issue. I see now why you jumped directly to that comment @yoshuawuyts.
Was looking at how diablo is adding more lifecycle events. Would be nice for adding css
intro and exit transitions.
@kristoferjoseph I think extra lifecycle events can be evaded by using a finite state machine; onload
/ onunload
should be the only hooks needed at the component level to create css animations. Perhaps take a look at the f1 package for an example of an animation state machine