Replies: 2 comments
-
Regarding observing any change in the graph - you may try using Regarding the persisting a store to localStorage - I'd suggest to use I am using it in production. It also allows to specify the delay:
|
Beta Was this translation helpful? Give feedback.
-
See also `deepObserve` in mobx-utils.
…On Thu, Jul 7, 2022 at 6:42 AM Egor Gorbachev ***@***.***> wrote:
Regarding observing any change in the graph - you may try using toJS
inside autorun: https://codesandbox.io/s/youthful-morse-wfvfch
Regarding the persisting a store to localStorage - I'd suggest to use
mobx-persist-store: https://github.com/quarrant/mobx-persist-store
I am using it in production. I also allows to specify the delay:
delay (Number) - Allows you to set a delay option to limit the amount of
times the write function is called. No delay by default.
For example if you have a 200 millisecond delay and two changes happen
within the delay time then the write function is only called once. If you
have no delay then the write function would be called twice.
—
Reply to this email directly, view it on GitHub
<#3454 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN4NBAAGARPZF4RAXT3ZV3VSZU55ANCNFSM524AAMKA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Mobx is great at only observing changes for things I care about.
But for serialization, whenever anything in the graph changes, I want to queue a LocalStorage each time (albeit behind a _.throttle to make it performant)
Is there a function to
observeAll(store)
just like you would get withreduxStore.subscribe()
?Beta Was this translation helpful? Give feedback.
All reactions