Skip to content

Commit

Permalink
Merge pull request #34 from Ruben-Arushanyan/4.4.0
Browse files Browse the repository at this point in the history
Remove Handler decorator
  • Loading branch information
Ruben-Arushanyan committed Oct 4, 2022
2 parents 485caca + 64606f5 commit 449e475
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 39 deletions.
19 changes: 0 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,25 +171,6 @@ const payload_2 = new Payload(Symbol('My Origin 2'), 'a', 'b')
// }
// }

```

## Handler

**Handler** is a decorator function that accepts a function and returns a function that can only accept Payload instances in its argument.

### basic usage

```js
import {Handler, Payload} from 'secure-event-emitter'

const myHandler = Handler((payload) => {
// ...
})

myHandler(new Payload(Symbol('my origin'), 1, 2, 3)) // OK
myHandler(2021) // TypeError('handler argument type must be a [[Payload]] class objects')


```

## useListener
Expand Down
18 changes: 0 additions & 18 deletions src/handler.js

This file was deleted.

2 changes: 0 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@

const {Handler} = require('./handler')
const {SecureEventEmitter} = require('./SecureEventEmitter')
const {SingularEventEmitter} = require('./singular-event-emitter')
const {Payload} = require('./payload')

module.exports = {
Handler,
SecureEventEmitter,
SingularEventEmitter,
Payload,
Expand Down

0 comments on commit 449e475

Please sign in to comment.