You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having trouble with Subject.create, it keeps throwing an error.
/home/username/src/RxJS/dist/cjs/Observable.js:134
return this.source._subscribe(this.operator.call(subscriber));
^
TypeError: Cannot read property 'call' of undefined
at BidirectionalSubject._subscribe (/home/username/src/RxJS/dist/cjs/Observable.js:134:52)
at BidirectionalSubject._subscribe (/home/username/src/RxJS/dist/cjs/Subject.js:186:37)
at BidirectionalSubject.subscribe (/home/username/src/RxJS/dist/cjs/Observable.js:103:29)
at Object.<anonymous> (/home/username/src/roslib-rx/dist/index.js:78:13)
at Module._compile (module.js:434:26)
at Object.Module._extensions..js (module.js:452:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:475:10)
at startup (node.js:118:18)
Here is the code I used. I'm trying to create a subject where I can both send and receive. Is this a bug or am I using the wrong method?
classReceiveTopic{constructor(options){returnnewObservable(obs=>{console.log('sub to ReceiveTopic');setTimeout(()=>{// simulate a value that is receivedobs.next('receive value from topic');},500);return()=>{console.log('unsub from ReceiveTopic');}});}}classSendTopic{constructor(options){returnSubscriber.create(function(data){console.log('send data:',data)},function(e){console.error('send error:',e);},function(){console.log('send done');});}}consttopic1=newReceiveTopic();consttopic2=newSendTopic();constduplexTopic=Subject.create(topic1,topic2);duplexTopic.subscribe(Subscriber.create(function(e){console.log('message:',e);},function(e){// errors and "unclean" closes land hereconsole.error('error: ',e);},function(){// the socket has been closedconsole.info('socket closed');}));duplexTopic.next('send data to topic');
The text was updated successfully, but these errors were encountered:
I'm having trouble with Subject.create, it keeps throwing an error.
Here is the code I used. I'm trying to create a subject where I can both send and receive. Is this a bug or am I using the wrong method?
The text was updated successfully, but these errors were encountered: