@bornkiller/observable
v0.3.1
Published
Predictable info stream with lite implement.
Downloads
2
Readme
observable
Predictable info stream with lite implement.
Usage
'use strict';
import { Observable } from '@bornkiller/observable';
const stream = new Observable();
const subscription = stream.subscribe((info) => {
console.log(info); // eslint-disable-line no-console
});
stream.next('hello world');
stream.next('nuclear weapon');
subscription.unsubscribe();
stream.next('dancing queen');
// output
// 'hello world'
// 'nuclear weapon'
Rollup
when choose rollup as build tool, configure package like below:
export default {
external: ['@bornkiller/observable'],
globals: {
'@bornkiller/observable': 'bk.observable'
}
};