Fork me on GitHub
#re-frame
<
2022-04-26
>
hadils16:04:36

I am using re-frame in a Expo React Native project with great success. However, many functions provided by Expo are asynchronous. I know how to implement these in Clojurescript with core.async and <p!. My question is: how can I build re-frame interceptors that use asynchronous functions? I have thought about this a lot but don’t have a solution. Things like local storage are accessed asynchronously and I would like to inject them as co-effect handlers. Any thoughts or suggestions would be most welcome.

p-himik17:04:37

Interceptors don't support async functionality. Regarding local store - there are CLJS libraries for it, and IIRC all or most of them create an atom that's backed by the local store, so the interface becomes synchronous.

hadils17:04:52

Thank you for the reply @U2FRKM4TW! I can implement it with atoms as you state.

👍 1