UI Consultant, Maker & Technical Writer.
I write about JS, TS, Rx, Angular & all things Front End
🇮🇹🇬🇧
Follow me on Twitter: https://twitter.com/gc_psk
Founder of https://makerkit.dev
Do you have a use-case in mind? Without knowing exactly the scenario, I think you don't need a Subject in such case, you should create an Observable creator and push values from the inside?
Etc in angular when the observablenis in a service but you push values from the component after user clicks.
.
what is the best practice to push values from inside into observable?
UI Consultant, Maker & Technical Writer.
I write about JS, TS, Rx, Angular & all things Front End
🇮🇹🇬🇧
Follow me on Twitter: https://twitter.com/gc_psk
Founder of https://makerkit.dev
The only way for that is to create a new Observable using new Observable(Observer) - where you define the source inside the observable and you push values/errors/completion with Observer.next, error and complete. Hope this helps!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
What will you use for a case you need to push values - but slso you need it unicasting?
Hi Yehonatan, interesting question!
Do you have a use-case in mind? Without knowing exactly the scenario, I think you don't need a Subject in such case, you should create an Observable creator and push values from the inside?
Etc in angular when the observablenis in a service but you push values from the component after user clicks.
.
what is the best practice to push values from inside into observable?
The only way for that is to create a new Observable using new Observable(Observer) - where you define the source inside the observable and you push values/errors/completion with Observer.next, error and complete. Hope this helps!