@footage.one/watchable
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

Watchable

Usage

import { Watchable, WatchableProperty } from '@footage.one/watchable';

// Class with a watchable property
class ClassWithState {
    @Watchable()
    public property: WatchableProperty<string>;
}

const instance = new ClassWithState();

// Watching on changes
instance.property.watch().subscribe({
    next: (value) => console.log(value)
});

// Setting value
instance.property.value = 'somestring value';

// Getting value
console.log(instance.property.value);

Readme

Keywords

none

Package Sidebar

Install

npm i @footage.one/watchable

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

25.4 kB

Total Files

23

Last publish

Collaborators

  • dasch