Comparing version 1.5.8 to 1.6.0
{ | ||
"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 @@ */ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
137675
27
3875