Fork me on GitHub

Came across some code that dispatches a re-frame event from a re-frame subscription handler. That feels kinda wrong to me, although I'm not sure I can put into words why. I guess I've always figured subscription handler functions oughta be pure, for one thing. Thoughts?


Yes, you are right, although the requirement does come up. Perhaps a clearer way of achieving the same thing would be to use


Thanks! That does look like it fits the bill. I'll look into it.


Sadly, prevents me from using that library in our project. Could fork it, maybe.


Or just copy paste :D I often do that with this kind of thing as you end up 'owning' it really


Yeah, that's one option. I can see myself using this in other projects down the line, though.


The code in subscription mentioned above shoud be probably moved into reg-fx. The subscriptions are for extracting and computation of data before showing it to the user.


Right, but determining whether the event that is currently being dispatched from the subscription should be dispatched at all relies on multiple other subscriptions, and I don't think it's OK to use subscriptions in reg-fx, either.


Hi, I made a simple app with re-frame. I don't need any security what is the fastest easiest way to persist app-db. Is there any library for sync'ing app-db with some real-db?


It can be written to a file too I just want to keep app-db for next session.


Thank you very much. I am checking it out.