Fork me on GitHub
#re-frame
<
2018-06-10
>
eoliphant18:06:48

Hi, I think I’m missing something obvious. I have an event-fx, that is making an ajax call. I need some values from the db in order to set it up properly. I am grabbing this from the pre-injected db, but I’m also trying to figure out, the best way to inject a value/coeffect from a subscription.

mikerod18:06:07

Has a interceptor you can use to inject subscriptions as cofx

mikerod18:06:34

It works pretty well. It’ll warm you if you are injecting subscription values that are only used by your event handlers

eoliphant18:06:46

ah cool thax!

mikerod18:06:06

Since it has to dispose those right away which may be perf overhead. You probably don’t have that situation though. It may be documenting in the readme

mikerod18:06:26

This lib is the one I see recommended by re-frame issues on the subject in the past too.

eoliphant18:06:22

great I will check it out. It seems like it would be a common need

Oliver George22:06:47

Could you use a helper in the event handler and pass the necessary context that way? Pts The event handler on charge. Safe and simple.