Basit Basit - 1 year ago 121
Javascript Question

Rxjs Subject next() after complete()

I have service which connects with

to do paging. I'm using
to pass to subject, which keeps things alive, now I need to use
on each ajax call and pass it to subject. but after doing one
I'm started get error.

I wanted to know, can we still pass
observables still
if once
is already been triggered?

Answer Source

There is some information on subjects from a former question on stack overflow : here. I encourage you to review it.

About your specific question, subjects once completed cannot emit any longer. This is part of the contract they abide by. Depending on the logic and flow of your application, you might:

  • decide not to complete the subject (why indeed are you completing it if you still need it later on?)
  • create a new subject whenever you need one, but then you have to pass it to whoever needs it.
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download