
Security News
npm Introduces minimumReleaseAge and Bulk OIDC Configuration
npm rolls out a package release cooldown and scalable trusted publishing updates as ecosystem adoption of install safeguards grows.
asteroids-listener
Advanced tools
Custom implementation of the observer pattern tailored for Asteroids

Custom implementation of the observer pattern tailored for Asteroids
var Listener = require('asteroids-listener');
var listener = new Listener();
var identifier = listener.addListener('change', function(){
console.log('a change occured');
})
listener.notifyOf('change');
listener.removeListener(identifier);
listener.notifyOf('change');
Output:
a change occured
var Listener = require('asteroids-listener');
var Discussion = function(){
Listener.call(this);
}
Discussion.prototype = new Listener();
Discussion.prototype.agreement = function(){
this.notifyOf('agreement');
};
var discussion = new Discussion();
discussion.addListener('agreement', function Stakeholder(){
console.log('celebrating');
})
discussion.agreement();
Output:
celebrating
FAQs
Custom implementation of the observer pattern tailored for Asteroids
We found that asteroids-listener 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
npm rolls out a package release cooldown and scalable trusted publishing updates as ecosystem adoption of install safeguards grows.

Security News
AI agents are writing more code than ever, and that's creating new supply chain risks. Feross joins the Risky Business Podcast to break down what that means for open source security.

Research
/Security News
Socket uncovered four malicious NuGet packages targeting ASP.NET apps, using a typosquatted dropper and localhost proxy to steal Identity data and backdoor apps.