Fork me on GitHub
#rum
<
2016-10-30
>
adamfrey20:10:07

I want to have a datascript connection available to every component in my tree. In Om.now, I can put the connection in global shared state and access it from anywhere (https://github.com/omcljs/om/wiki/Documentation#get-shared). Is there a way to do this in Rum?

adamfrey20:10:48

I know rum doesn’t have opinionated state management

adamfrey20:10:24

has anyone tried to use dynamic vars with Rum to accomplish something like this? It’s not working for me, but I also could be doing something wrong

martinklepsch21:10:39

@adamfrey: dynamic vars only work in fully synchronous code

martinklepsch21:10:51

It might be more reliable to use component context

martinklepsch21:10:18

There's an example for that in the rum examples I believe. Also there's another example in martinklepsch/derivatives on GitHub

jupl21:10:01

How can I use context with server-side rendering? I am working on a universal app where the client-side uses context.

jupl21:10:16

I can’t use js/React.PropTypes in a cljc file.

adamfrey22:10:18

@martinklepsch I looked into that. How can I pass a custom type that aren’t in PropTypes? Or can I just pass a function that returns the connection, maybe?