Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pubst

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pubst - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

3

CHANGELOG.md
## v0.0.5 - Jan 04 2018
+ Adds basic console message when publishing to a topic that has not matching subscribers. I will likely make this configurable later.
## v0.0.4 - Jan 02 2018
+ Fixes race condition that caused subscribers to be called with topic value at time of subscriber call instead of published value.

13

lib/pubst.js
'use strict';
/*
* Pubby - Basic JavaScript Pub/Sub Event Emitter
* Pubst - Basic JavaScript Pub/Sub Event Emitter
*

@@ -53,5 +53,10 @@ * Copyright 2017 Jason Schindler

subs.forEach(function (sub) {
scheduleCall(sub, store[topic], topic);
});
if (subs.length === 0) {
// eslint-disable-next-line no-console
console.warn('WARNING:: There are no subscribers that match \'' + topic + '\'!');
} else {
subs.forEach(function (sub) {
scheduleCall(sub, store[topic], topic);
});
}
}

@@ -58,0 +63,0 @@ }

{
"name": "pubst",
"version": "0.0.4",
"version": "0.0.5",
"description": "Basic JavaScript Pub/Sub Event Emitter",

@@ -5,0 +5,0 @@ "main": "lib/pubst.js",

@@ -8,3 +8,3 @@ # Pubst

+ Allow subscribers to define default payloads to be sent in the event of an empty or `null` publish.
+ Warnings when publishing to a topic that has no subscribers. (Not implemented here either)
+ Warnings when publishing to a topic that has no subscribers.
+ Allow for a subscription to all topics. (Not implemented here either)

@@ -11,0 +11,0 @@

/*
* Pubby - Basic JavaScript Pub/Sub Event Emitter
* Pubst - Basic JavaScript Pub/Sub Event Emitter
*

@@ -51,5 +51,10 @@ * Copyright 2017 Jason Schindler

subs.forEach(sub => {
scheduleCall(sub, store[topic], topic);
});
if (subs.length === 0) {
// eslint-disable-next-line no-console
console.warn(`WARNING:: There are no subscribers that match '${topic}'!`);
} else {
subs.forEach(sub => {
scheduleCall(sub, store[topic], topic);
});
}
}

@@ -56,0 +61,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