Fork me on GitHub
#rum
<
2016-12-18
>
pbaille18:12:06

Hi, i’m trying to make a mixin to facilitate communication between child and parent component in rum, it is using core.async for the communication, it is just 50 lines of code minus the detailed/explained example: https://gist.github.com/pbaille/67e0314f0dac251bdc0aefc7233460fc any advices would be welcome

pbaille18:12:56

I’m also wondering if anyone has tried to adapt https://github.com/binaryage/pure-frame for rum, I think it should be useful

misha18:12:00

@pbaille why would you do that (mixin)?

pbaille18:12:44

your question is about pure-frame or my gist mixin?

pbaille18:12:15

for pure-frame: because re-frame minus global state sounds amazing.

pbaille18:12:32

for my mixin: because when I’m trying to compose several components, my code gets messy with lots of callback and coordination.

metametadata21:12:14

@pbaille from my understanding of re-frame/pure-frame you'll still have a single state db in your app. So that you must not keep any business logic state/functions inside UI components. Instead all UI components must dispatch events "into the framework" to change the app db. On next tick the GUI will be redrawn accordingly to new db state.

metametadata21:12:10

Maybe you could use several instances of pure-frame to talk with each other...

metametadata21:12:23

There's currently an interesting trend going in Elm against such patterns. They promote splitting functions instead of extracting "components": https://guide.elm-lang.org/reuse/