Skip to content

Commit

Permalink
fix eventChannel#close issue
Browse files Browse the repository at this point in the history
  • Loading branch information
yelouafi committed Apr 20, 2016
1 parent c5da0be commit 0afd32d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/internal/channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,10 @@ export function eventChannel(subscribe, matcher, buffer) {
return {
take: chan.take,
close: () => {
chan.close()
unsubscribe()
if(!chan.__closed__) {
chan.close()
unsubscribe()
}
}
}
}
2 changes: 1 addition & 1 deletion test/proc/channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ test('proc queue store actions', assert => {

let actual = [];
let dispatch
const input = (cb) => dispatch = cb
const input = (cb) => { dispatch = cb; return () => {} }


function* genFn() {
Expand Down

0 comments on commit 0afd32d

Please sign in to comment.