Watch a reactive effect and re-run it when its dependencies change.
The reactive effect to watch.
A disposer function to stop watching the effect.
import { watch, writable, reactiveMap } from "./watch";const count$ = writable(0);const map$ = reactiveMap();watch((get) => { console.log(get(count$)); console.log(get(map$).get("key"));}); Copy
import { watch, writable, reactiveMap } from "./watch";const count$ = writable(0);const map$ = reactiveMap();watch((get) => { console.log(get(count$)); console.log(get(map$).get("key"));});
Watch a reactive effect and re-run it when its dependencies change.