subject-matter

0.1.0 • Public • Published

Subject Matter provides a simple subject for the observer pattern.

import Subject from 'subject-matter';

const s = new Subject(0);

const unsubscribe = s.subscribe(v => console.log('value is', v));

s.update(1); // Outputs "value is 1" to the console.
unsubscribe();
s.update(2); // Does nothing.

Readme

Keywords

none

Package Sidebar

Install

npm i subject-matter

Weekly Downloads

1

Version

0.1.0

License

ISC

Unpacked Size

2.72 kB

Total Files

4

Last publish

Collaborators

  • pancakeoverflow