@zalky did you use leaflet directly or react-leaflet ?
@zackteo, started with leaflet, eventually migrated to react-leaflet.
Oo, okay okay - I was wondering if the reverse might be needed but i guess react-leaflet is actually more than flexible
@zalky btw, by any chance do you have an example of this approach? If not no worries, I'll try to figure it out along the way 🙂
@zackteo, unfortunately I can't share the code, but there are not too many moving parts. Mostly using [:> Component props children ...]
operators plus the update approach described above. I think as we moved to react-leaflet, we moved some of the leaflet mutations out of the update reaction, and just passed them as simple props to the react component (zoom, center, stuff like that). Maybe you've already seen this, but if you haven't, here is a very common pattern that is effectively the same thing as using an update reaction:
https://github.com/day8/re-frame/blob/master/docs/Using-Stateful-JS-Components.md
Well, it's not exactly the same: with this approach, you do have to option of make your reactive update a function of two states. Potentially with this approach you can be more efficient and refined in how you update your mutable JS object, but it can be more complicated to reason about, and depending on your implementation, you can potentially lose some nice properties, such as time travel.
Thanks for your help!! 😄
No problem, good luck!
whoops, I didn't actually express why: re-frame-10x uses window.localStorage
, which is not available to sandboxed iframes.
Seems like this is a proper feature request. If so, I think it would be better suited for GitHub. Clojurians Slack is fleeting because it's on the free plan.
Will do.
1👍