1.0.1 • Published 1 month ago

@zjxpcyc/observe-ext v1.0.1

Weekly downloads
-
License
MulanPSL
Repository
-
Last release
1 month ago

@zjxpcyc/observe-ext

极简 发布订阅模式 .

增加了一个扩展功能

安装

npm install @zjxpcyc/observe-ext -S

使用

基本使用

import observe from '@zjxpcyc/observe-ext';

const { publish, subscribe, unsubscribe } = observe();

扩展使用

import observe from '@zjxpcyc/observe-ext';

// obs 就是默认的 observe 输出
const enhancer = (obs) => {
  return {
    ...obs,
    print: console.log,
  }
}

// print 就是扩展的方法
const { print, publish, subscribe, unsubscribe } = observe(enhancer);
1.0.1

1 month ago

1.0.0

2 months ago