#How to call a function when data in "useStore({})" changes?

4 messages · Page 1 of 1 (latest)

unreal ibex
#

the use case?

#

well, I want to update local storage whenever data in useStore() updates

meager monolith
#

This seems to do the trick.

useTask$(({ track }) => {
  for(const key in store) {
    track(() => store[key])
  }
  console.log(store)
});
unreal ibex
#

Oh yes, must work nicely