Skip to content

ajuni880/plain-observable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published