Skip to content

Commit 7f42cd2

Browse files
authored
Change example
Pulling the example code together causes an `Uncaught exception TypeError: Illegal invocation` to be thrown on `drain.js:24` ![image](https://cloud.githubusercontent.com/assets/193412/16537329/dffd915a-3fb4-11e6-8b05-a93b4186c541.png) ```js const pull = require('pull-stream') const Notify = require('pull-notify') const notify = Notify() pull(notify.listen(), pull.drain(console.log)) notify('hello', 'world') notify.end() ``` [requirebin link](http://requirebin.com/?gist=01253780c25ce4a6675b8e54fac7c1d0) This is because, at least in Chrome, the `console` object must be bound to the `console` object for `this`.
1 parent 15010fa commit 7f42cd2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var notify = Notify()
1919

2020
//create a pull stream that listens on events.
2121
//it will eventually get all events.
22-
pull(notify.listen(), pull.drain(console.log))
22+
pull(notify.listen(), pull.drain((evt) => console.log(evt)))
2323

2424
notify('hello') //emit an event.
2525

0 commit comments

Comments
 (0)