Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

Commit

Permalink
Fixing Issue #915
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpodwysocki committed Sep 16, 2015
1 parent 201d9c8 commit c51b2a5
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions doc/api/core/operators/fromevent.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,20 @@ var EventEmitter = require('events').EventEmitter,
var eventEmitter = new EventEmitter();

var source = Rx.Observable.fromEvent(
eventEmitter,
'data',
function (foo, bar) {
return { foo: bar, bar: bar };
});
eventEmitter,
'data',
function (foo, bar) { return { foo: bar, bar: bar }; });

var subscription = source.subscribe(
function (x) {
console.log('Next: foo -' + x.foo + ', bar -' + x.bar);
},
function (err) {
console.log('Error: ' + err);
},
function () {
console.log('Completed');
});
function (x) {
console.log('Next: foo -' + x.foo + ', bar -' + x.bar);
},
function (err) {
console.log('Error: ' + err);
},
function () {
console.log('Completed');
});

eventEmitter.emit('data', 'baz', 'quux');
// => Next: foo - baz, bar - quux
Expand Down

0 comments on commit c51b2a5

Please sign in to comment.