Fork me on GitHub
#re-frame
<
2018-10-30
>
ingesol12:10:54

@zalkySo basically a middleware/interceptor for re-frame's event processing?

zalky13:10:43

@ingesol, thanks for the response! The main stumbling block towards using interceptors for this use case was that the fn had to run once after all handled events, but before subscriptions/reactions synced. So: re-frame handles events -> (some-fn) -> render/sync -> re-frame handles events -> (some-fn) -> render/sync ... etc. Somehow the interceptor would have to be the last one processed in the handled event queue and I wasn't sure how to guarantee that. Maybe there was a way to do it in the end, with interceptors, or next-tick, but it felt like fighting against the framework. Taking a step back, I was luckily able to refactor the larger algorithm that this was a part of to avoid the pattern all-together.

ingesol13:10:20

@zalky Sounds like the way to go 🙂

😀 4