re-frame

jherrlin 2024-04-19T19:40:10.760519Z

Hi, In the app I'm currently working on I have an effect: (rf/reg-fx :fetch fetch). This effect is used in many places and not simple to change. I would like to start using https://github.com/superstructor/re-frame-fetch-fx side-by-side with our current :fetch . The problem is the naming conflict on :fetch in the re-frame-fetch-fx and our internal. Is there a smooth way to solve this?

p-himik 2024-04-19T19:57:12.045469Z

Three options: • Don't use the library, implement only the stuff that you need on your own • Use it, require its namespace, call (re-frame.core/clear-fx :fetch) and register your own :fetch • Vendor the library in (the license is very permissive) and modify it in-place

👍 1
jherrlin 2024-04-19T20:00:30.262249Z

Can I do 2 reliably?

p-himik 2024-04-19T20:04:46.453329Z

Pretty sure that yes. Namespaces are loaded only once in CLJS, so that reg-fx in the library won't be re-executed.

jherrlin 2024-04-19T20:09:03.313309Z

Thx @p-himik! Ill try that path.

👍 1