
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@yugu/subscribe
Advanced tools
使用`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
使用import Subscribe from "@yugu/subscribe"导入类
通过const pool = new Subscribe创建发布订阅实例
该类实例可以通过add方式向订阅池中添加事件,pool.add(fn)
该类实例可以通过remove方式从订阅池中移除事件,pool.remove(fn)
该类实例可以通过fire方式触发订阅池中所有的函数,pool.fire()
<script type="module">
import Subscribe from "@yugu/subscribe";
const btn = document.querySelector(".submit");
const pool = new Subscribe();
const fn1 = () => {
console.log(1);
};
const fn2 = () => {
console.log(2);
pool.remove(fn1);
};
const fn3 = () => {
console.log(3);
};
const fn4 = () => {
console.log(4);
};
pool.add(fn1);
pool.add(fn2);
pool.add(fn3);
pool.add(fn4);
btn.onclick = function (event) {
pool.fire();
console.log(pool);
};
</script>
FAQs
使用`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
We found that @yugu/subscribe demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.