How can I synchronize two stores without running into an infinite loop?
The following code triggers an infinite loop:
How can I update one when the other changes and avoid this?
How can I update one when the other changes and avoid this?
const [store1, setStore1] = createStore({a: 1, b: 2});
const [store2, setStore2] = createStore();
createEffect(() => {
setStore1(store2);
});
createEffect(() => {
setStore2(store1);
});