New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pubsub-js

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pubsub-js - npm Package Compare versions

Comparing version 1.5.8 to 1.6.0

.npmignore

2

package.json
{
"name": "pubsub-js",
"version": "1.5.8",
"version": "1.6.0",
"description": "Dependency free publish/subscribe library",

@@ -5,0 +5,0 @@ "main": "./src/pubsub.js",

@@ -178,2 +178,17 @@ /*

/**
* PubSub.subscribeOnce( message, func ) -> PubSub
* - message (String): The message to subscribe to
* - func (Function): The function to call when a new message is published
* Subscribes the passed function to the passed message once
**/
PubSub.subscribeOnce = function( message, func ){
var token = PubSub.subscribe( message, function(){
// before func apply, unsubscribe message
PubSub.unsubscribe( token );
func.apply( this, arguments );
});
return PubSub;
};
/* Public: Clears all subscriptions

@@ -180,0 +195,0 @@ */

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc