0.1.1 • Published 8 months ago

@-ft/watch-target v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Util - watchTarget

get notified when the watch target value changes

Usage

const a = watchTarget('a');

const cleanup = a.watch((a) => console.log(`a is now '${a}'`));
// console output: a is now 'a'

a.get(); // 'a'

a.set('A');
// console output: a is now 'A'

cleanup();

a.set('X'); // (no more console output)
0.1.1

8 months ago

0.1.0

8 months ago