Rxjs Subject next () after completion ()

I have a service that connects to Subject()for swap work. I use next(newData)to go to a topic that saves life, now I need to use complete()ajax for each call and pass it to the subject. but after doing one, complete()I started getting an error.

I wanted to know if we can still go through the Subjectobservables yet next(newData), if once completed()already launched?

+4
source share
1 answer

There is some information on topics from the previous stack overflow question: here . I recommend that you familiarize yourself with it.

About your specific question, items upon completion cannot emit anymore. This is part of the contract that they comply with. Depending on the logic and flow of your application, you can:

  • decide not to fill out the topic (why are you really completing it, if you still need it?)
  • create a new theme when you need it, but then you must pass it on to those who need it.
+7
source

All Articles