Skip to content

Commit

Permalink
fix: rename onMiss to onMissed
Browse files Browse the repository at this point in the history
  • Loading branch information
unional committed Mar 15, 2018
1 parent ac8f104 commit ad574b3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ emitter.queue(count, value => console.info(value))
emitter.onAny(fsa => console.info(fsa.type, fsa.payload))

// listen to any event that does not have a listener
emitter.onMiss(fsa => console.info(fsa.type, fsa.payload))
emitter.onMissed(fsa => console.info(fsa.type, fsa.payload))
```

## Command
Expand Down
8 changes: 4 additions & 4 deletions src/Emitter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,11 @@ test('onAny() returns subscription second remove is noop', t => {
t.is(type, 'x')
})

test('onMiss() listens to all not listened events', t => {
test('onMissed() listens to all not listened events', t => {
const emitter = new Emitter()

let type = ''
emitter.onMiss(fsa => {
emitter.onMissed(fsa => {
type += fsa.type
})
emitter.on('x', () => { return })
Expand All @@ -237,7 +237,7 @@ test('onMiss() returns subscription for removing itself', t => {
const emitter = new Emitter()

let type = ''
const sub = emitter.onMiss(fsa => {
const sub = emitter.onMissed(fsa => {
type += fsa.type
})
emitter.on('x', () => { return })
Expand All @@ -252,7 +252,7 @@ test('onMiss() returns subscription second remove is noop', t => {
const emitter = new Emitter()

let type = ''
const sub = emitter.onMiss(fsa => {
const sub = emitter.onMissed(fsa => {
type += fsa.type
})
emitter.on('x', () => { return })
Expand Down
2 changes: 1 addition & 1 deletion src/Emitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export class Emitter {
}
}

onMiss(listener: (fsa: FluxStandardAction<any>) => void) {
onMissed(listener: (fsa: FluxStandardAction<any>) => void) {
this.listenMisses.push(listener)
return {
remove: () => {
Expand Down

0 comments on commit ad574b3

Please sign in to comment.