Fork me on GitHub
#rum
<
2017-06-05
>
levitanong02:06:51

@martinklepsch Here’s another gotcha! get-ref doesn’t work in will-unmount because the derivatives are absent.

levitanong02:06:23

I’m not using it for my project, (i found the above issue because of stale code) but I thought I’d let you know anyway.

levitanong02:06:22

Oh wait, i realize this is a natural consequence of order-dependency and the lifecycle-ness of rum mixins.

levitanong03:06:33

The derivatives mixin always includes unmount code—the only way to make it available to the will-unmount lifecycle method is if d/drv is split its respective will-mount and will-unmount sections.

levitanong03:06:40

An alternative is to pass some lifecycle hooks to the derivatives mixin itself so that the mixin calls the hooks that depend on the derivatives before killing itself in its own will-unmount.

martinklepsch15:06:44

@levitanong maybe also did-unmount is an option to be considered?

martinklepsch15:06:28

@levitanong I’m a bit tired after a day of travel but if you open an issue I’m open to improvements in that regard 🙂

levitanong15:06:31

@martinklepsch I don’t think did-unmount exists as a lifecycle hook 😛 I’ll open an issue. Rest well!

martinklepsch15:06:51

@levitanong ha 😄 you seem to be right but some places mention it… maybe it got pulled at some point?

martinklepsch15:06:08

(referring to React not Rum here)

levitanong15:06:56

If they do add a did-unmount, that would be pretty cool. I always felt there was a certain lack of symmetry in their lifecycle hooks. I also wish they folded in the React Transitioner lifecycle methods for allowing a component to “animate away” when unmounting.