reagent

Chris McCormick 2023-01-03T09:37:05.451909Z

I frequently run into a situation using Alan Dipert's local-storage where I have my entire app state in one atom but I only want to persist a certain subset of the atom into localStorage. I solved this by forking local-storage and adding functions for selecting which keys to persist. I also tested wrapping a Reagent cursor in local-storage but it didn't work because the cursor data is not persisted when the higher level atom is swapped (only when the cursor itself is swapped). Is there some more elegant method I am missing?

grav 2025-12-20T15:34:43.375899Z

Just looking at the same scenario. How about add-watch on the two atoms (the reagent-one and local-storage one) and then updating one when there are relevant changes on the other?

👍 1