2.0.1 • Published 2 years ago

melv_observable v2.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

melv_observable

A class containing a private value and a set of functions to run whenever the value is updated.

Examples

const countObservable = new Observable<number>();

const stopLoggingCount = countObservable.subscribe((count) => {
  console.log(`count: ${count}`);
});

countObservable.value = 0; // logs "count: 0"

setInterval(() => {
  countObservable.value++;
  if (countObservable.value === 5)
    stopLoggingCount();
}, 1000); // increments and logs count every second
2.0.1

2 years ago

2.0.0

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago