wegi 2020-07-14T12:06:43.458200Z

I am having a hard time implementing a concept the re-frame way: When a certain event :foo is dispatched I want to check whether :bar is already in the app-db and if not query it from the backend. I can't imagine how I am supposed to do that with pure events. I thought about writing an effect, but then again I am thinking I am maybe overcomplicating what I am about to do.

wegi 2020-07-14T12:12:10.459Z

From what I am understanding I probably should write some fx, that checks for the data in the cache and fires the appropriate effect for retrieval if not. Correct?

p-himik 2020-07-14T12:16:31.460100Z

Correct, only the first "fx" in your last messages should be replaced with "event handler".

wegi 2020-07-14T12:19:37.460400Z

Ah of course, thank you. :thumbsup:

beders 2020-07-14T15:17:00.460700Z

Check out #kee-frame, which has an elegant solution for this using url-based routing and controllers

lilactown 2020-07-14T15:21:18.461500Z

the other option is that the thing that dispatches :foo can pass in the previous :bar (or detect if it’s available)

p-himik 2020-07-14T15:26:56.462900Z

A not obvious downside - it may become (un)available again when :foo is handled.