This article is a mirror article of machine translation, please click here to jump to the original article.

View: 18908|Reply: 3

[Angular] Subject topic subscription for Angular RxJS

[Copy link]
Posted on 5/14/2020 3:37:05 PM | | | |
Subject is a subclass of Observable. - Subject is multicast, allowing values to be multicast to multiple observers. Normal observables are unicast.

Inside the subject, subscribe doesn't call a new execution of the sent value. It simply registers a given observer to the watcher list, similar to how addListener works in other libraries or languages.

To give a new value to a Subject, simply call next(theValue) and it will multicast the value to observers who have registered to listen to the Subject.



Each subject is an observer. - Subject is an object with the following methods: next(v), error(e), and complete(), which can be passed as an argument to any observable subscribe method.







Previous:js browser pops up a new form
Next:Seek completeness - Node.js Develop a web server blog project from scratch Thank you
 Landlord| Posted on 5/14/2020 3:42:07 PM |


next - The next method is called whenever the Subject object receives a new value.
error - If an exception occurs during operation, the error method will be called.
complete - The complete method is called after the Observable object of the Subject subscription ends.
subscribe - Add observers.
unsubscribe - unsubscribe (set termination identifier, empty observer list).
 Landlord| Posted on 9/18/2022 4:05:36 PM |
The RxJS finalize operator executes the logic after the Observable terminates
https://www.itsvse.com/thread-10333-1-1.html
 Landlord| Posted on 1/27/2024 12:19:58 PM |
Explore topics in the .Net Reactive Responsive Extension
https://www.itsvse.com/thread-10722-1-1.html
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com