yarn install && yarn dev
See the demo code in src/routes/index.svelte
yarn install && yarn package
files are in dist
folder
yarn install && yarn build
files are in build
folder
import { watch, watchStream } from 'async-values';
// activate plugin in the top level file of the project
onMount(() => isDev && AVWatch.activate(true));
// watch Subject
const userId = new BehaviorSubject(0);
const subscription = watchStream('userId', userId);
// watch stream pipe chain
const user = userId.pipe(
watch('user', 'beforeFetch'),
switchMap((userId) => fromFetch('//my-api.com/users/' + userId)),
watch('user', 'afterFetch'),
switchMap((response) => response.json()),
watch('user', 'afterParsing'),
);
// Press Ctrl + Alt to view the Watcher
// While the Watcher is open, press H for help and shortcuts