UNPKG

@yugu/subscribe

Version:

使用`import Subscribe from "@yugu/subscribe"`导入类 通过`const pool = new Subscribe`创建发布订阅实例 该类实例可以通过`add`方式向订阅池中添加事件,`pool.add(fn)` 该类实例可以通过`remove`方式从订阅池中移除事件,`pool.remove(fn)` 该类实例可以通过`fire`方式触发订阅池中所有的函数,`pool.fire()` ```js <script type="module"> imp

1 folder, 2 files
3.57 kB
954 B
833 B