Namespace: Basic:Observable

Basic:Observable

Source:

Members

(static) Observable

A class offering the bare minimum feature set to observe a value and subscribe to future value changes. No automatic magic going on here, this simply follows a basic subscription pattern, where each subscription is a function, being called with a newly set value. This closely resembles the kind of observables knockout is using.

For details, see class documentation below.

Source:
See:
Example
const status = new Observable('ok');
const subscription = status.subscribe(s => {
    console.log(`status changed to: ${s}`);
});
status.setValue('oh noez');
status.unsubscribe(subscription);