@bornkiller/observable

0.3.1 • Public • Published

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'
  }
};

Readme

Keywords

Package Sidebar

Install

npm i @bornkiller/observable

Weekly Downloads

0

Version

0.3.1

License

ISC

Last publish

Collaborators

  • trashbox