0.2.8 • Published 2 years ago

async-values v0.2.8

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

async-values

How to try

yarn install && yarn dev

See the demo code in src/routes/index.svelte

How to build component library

yarn install && yarn package

files are in dist folder

How to build demo application

yarn install && yarn build

files are in build folder

How to use Watcher in my project

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
0.2.1

2 years ago

0.2.0

2 years ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.8

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.5

2 years ago

0.1.6

2 years ago

0.2.4

2 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago