@peter.naydenov/notice 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -48,7 +48,7 @@ Register a regular event.
48
48
  ```js
49
49
  const eBus = notice ();
50
50
 
51
- eBus.on ( 'start', ([name]) => console.log ( `Hey, ${name}!` ) ) // notice that data params from emit are coming as array
51
+ eBus.on ( 'start', name => console.log ( `Hey, ${name}!` ) )
52
52
  eBus.emit ( 'start', 'Johny' )
53
53
  // ---> Hey, Johny!
54
54
  eBus.emit ( 'start', 'Vessy' )
@@ -64,7 +64,7 @@ Register a single event.
64
64
  ```js
65
65
  const eBus = notice ();
66
66
 
67
- eBus.once ( 'start', ([name]) => console.log ( `Hey, ${name}!` ) ) // notice that data params from emit is coming as array
67
+ eBus.once ( 'start', name => console.log ( `Hey, ${name}!` ) ) // notice that data params from emit is coming as array
68
68
  eBus.emit ( 'start', 'Johny' )
69
69
  // ---> Hey, Johny!
70
70
  eBus.emit ( 'start', 'Vessy' )
@@ -114,8 +114,8 @@ Trigger the event and execute all subscribed functions.
114
114
  let result = 0;
115
115
  const
116
116
  eBus = notice ()
117
- , fn1 = ([x]) => result += 1 + x
118
- , fn2 = ([x]) => result += 3 + x
117
+ , fn1 = x => result += 1 + x
118
+ , fn2 = x => result += 3 + x
119
119
  ;
120
120
  eBus.on ( 'go', fn1 )
121
121
  eBus.on ( 'go', fn2 )
@@ -135,8 +135,8 @@ Disable specified event.
135
135
  let result = 0;
136
136
  const
137
137
  eBus = notice ()
138
- , fn1 = ([x]) => result += 1 + x
139
- , fn2 = ([x]) => result += 3 + x
138
+ , fn1 = x => result += 1 + x
139
+ , fn2 = x => result += 3 + x
140
140
  ;
141
141
  eBus.on ( 'go', fn1 )
142
142
  eBus.on ( 'go', fn2 )
@@ -157,8 +157,8 @@ Enable again specified event.
157
157
  let result = 0;
158
158
  const
159
159
  eBus = notice ()
160
- , fn1 = ([x]) => result += 1 + x
161
- , fn2 = ([x]) => result += 3 + x
160
+ , fn1 = x => result += 1 + x
161
+ , fn2 = x => result += 3 + x
162
162
  ;
163
163
  eBus.on ( 'go', fn1 )
164
164
  eBus.on ( 'go', fn2 )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peter.naydenov/notice",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Event emmiter - NOTICE",
5
5
  "main": "src/main.js",
6
6
  "scripts": {
@@ -18,7 +18,7 @@
18
18
  "license": "ISC",
19
19
  "devDependencies": {
20
20
  "chai": "4.3.6",
21
- "mocha": "9.2.1",
21
+ "mocha": "10.0.0",
22
22
  "nyc": "15.1.0"
23
23
  },
24
24
  "nyc": {
package/src/main.js CHANGED
@@ -1,11 +1,11 @@
1
1
  "use strict"
2
2
  function notice () {
3
- let
4
- scroll = {} // General events with their subscribers
5
- , scrollOnce = {} // Single events with their subscribers
6
- , ignore = [] // Ignore event names ( general and single )
7
- ;
8
3
  function Notice () {
4
+ let
5
+ scroll = {} // General events with their subscribers
6
+ , scrollOnce = {} // Single events with their subscribers
7
+ , ignore = [] // Ignore event names ( general and single )
8
+ ;
9
9
  function on ( e, fn ) {
10
10
  if ( !scroll[e] ) scroll[e] = []
11
11
  scroll[e].push ( fn )