plain-observable
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

A simple observable

import { Subject } from 'plain-observable';
 
const source = new Subject<number>();
 
const unregister1 = source.register({
    update(value) {
        console.log('1',value);
    }
})
 
source.register({
    update(value) {
        console.log('2',value);
    }
});
 
source.notify(1)
 
unregister1();
 
source.notify(2)

Package Sidebar

Install

npm i plain-observable

Weekly Downloads

267

Version

1.1.1

License

ISC

Unpacked Size

4.53 kB

Total Files

10

Last publish

Collaborators

  • ajuni