zackteo 2021-06-16T05:29:22.135500Z

@zalky did you use leaflet directly or react-leaflet ?


@zackteo, started with leaflet, eventually migrated to react-leaflet.

zackteo 2021-06-16T12:56:46.135900Z

Oo, okay okay - I was wondering if the reverse might be needed but i guess react-leaflet is actually more than flexible

zackteo 2021-06-16T12:57:53.136100Z

@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:


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.

zackteo 2021-06-16T13:19:39.136900Z

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.

p-himik 2021-06-16T17:26:26.138200Z

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.