Skip to content

huang-xiao-jian/observable

Repository files navigation

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

About

Predictable info stream with lite implement.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published