re-frame

https://github.com/Day8/re-frame/blob/master/docs/README.md https://github.com/Day8/re-frame/blob/master/docs/External-Resources.md
zackteo 2021-06-16T05:29:22.135500Z

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

2021-06-16T12:55:23.135700Z

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

2021-06-16T13:07:42.136300Z

@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

2021-06-16T13:13:28.136700Z

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!! 😄

2021-06-16T13:19:52.137100Z

No problem, good luck!

2021-06-16T17:24:56.138100Z

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.

2021-06-16T17:30:11.138400Z

Will do.

1👍