0.0.2 • Published 6 years ago

@footage.one/watchable v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

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);