publisher-subscriber-pattern
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -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] |
{ | ||
"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); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23814
477
79