Fork me on GitHub

Are there any examples of rum used with routing such as funcool/bide?


@anton try to add < rum/static


@nxqd I should have read that, thanks.


using < (d/rum-derivatives drv-spec) on parent component instead of calling children with explicit arguments smells too funny for me harold


@misha derivatives are passed via React Context as you’ve probably seen. It’s a tradeoff to avoid having to always pass them down as an argument


@martinklepsch: I figured. On the other hand, if context is set just once at the top level, it might be okaish, need to give it a try


@misha yeah, idea is definitely that you only use the rum-derivatives mixin once


you could use a top-level def alternatively, the API supports that but I don’t think that’s any better than using context. At least context is more easily swappable in tests etc.


Do changes to derived values propagate back to the original value/atom? Or is it just read-only cascade of derived atoms?


thank you guys! I tried derived-atom and it speeded up everything


I am still not sure, but I think the problem was that because global state is a different object and components receive it in props, then all of them thinks they should re-render


@martinklepsch thank you! I think I ended up with something similar to scrum —


@misha read only cascade, no upward propagation. I prefer the re-frame model of pushing events through a dispatcher.


@anton one important note on rum.core/derived-atom: if you create them programatically they will not “clean up after themselves”. Each derived atom adds watches on it’s source atoms. As long as you defonce those it’s fine but if you don’t you’ll end up computing the same things many times due to duplicate watches.


@martinklepsch I understand that, and glad that you confirmed my thoughts


I tried same project with reagent and re-frame and for me it very quick became messy =/


too many abstractions — 3 types of components, subscriptions, handles, effects. My biggest concern was very tight coupling between components/handlers/subscriptions, while having code in three different locations


@misha yes, it saved the day in the end. problem was that the state prop was a global state, so < r/static could not do much before


@martinklepsch I read a readme of SCRUM, what do you think about passing reconciler around the compoents tree?


I also found couple of things troubling: - component name is a plain keyword, which tightly couples controller UI component to reconciler definition. Meaning in following code: [:button {:on-click #(scrum/dispatch! r :counter :dec)} "-"] you have to attentively keep track of the controller :counter name. I tried namespaced keywords, but could not get it working - when defining a reconciler you have to manually list all components. I think this is a way to avoid global reconciler, but I don't mind having a global one