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

publisher-subscriber-pattern

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

publisher-subscriber-pattern - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

4

CHANGELOG.MD

@@ -0,1 +1,4 @@

# @1.3.1 [author: Katarzyna Ziomek-Zdanowicz, date: 2019.09.07]
* modifies README
# @1.3.0 [author: Katarzyna Ziomek-Zdanowicz, date: 2019.09.07]

@@ -5,2 +8,3 @@ * converts publisher's subscribersCount to method

* exports type SubscribersEventCallback
* modifies README

@@ -7,0 +11,0 @@ # @1.2.0 [author: Katarzyna Ziomek-Zdanowicz, date: 2019.09.07]

2

package.json
{
"name": "publisher-subscriber-pattern",
"version": "1.3.0",
"version": "1.3.1",
"description": "Publisher subscriber pattern that can be used with different event emitters including browser window",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

# About
* Javascript implementation of publisher subscriber pattern
* Can be used with different event emitters including browser window
* Can be used with various event emitters including browser's window object
* Provides **Publisher** class
# Installation
`npm i publisher-subscriber-pattern`
```javascript
npm i publisher-subscriber-pattern
```

@@ -20,3 +22,3 @@ # Example

*Publisher* *subscribe* method returns function, which can be used later to unsubscribe from the event.
*Publisher's* *subscribe* method returns function, which can be used later to unsubscribe from the event.

@@ -31,2 +33,8 @@ ```javascript

There is also a method *unsubscribeAll* for unsubscribing all subscribers from all events.
```javascript
publisher.unsubscribeAll();
```
# API

@@ -33,0 +41,0 @@ ## **Publisher**

@@ -81,2 +81,6 @@ require('chai');

expect(typeof callback1).toBe('function');
// TODO check number of subscribers
// TODO przed publikacja: zmienic poprzedniego taga, uzupelnic README o przyklad instalacji, wyeksporotwac potrzebne mi typy
// złapać testami to czego nie łapałam poprzednio
});

@@ -83,0 +87,0 @@

@@ -46,2 +46,3 @@ import {

count += eventData[ 1 ].length;
console.log('count', count);
return count;

@@ -48,0 +49,0 @@ }, 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