How to share your RxJS observables for improved performance

How to share your RxJS observables for improved performance

Joshua Morony

2 года назад

23,130 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@tuvok86
@tuvok86 - 09.10.2023 15:37

if i do exactly but with students instead of clients than i get an error TS2345: Argument of type 'MonoTypeOperatorFunction<Student[]>' is not assignable to parameter of type 'OperatorFunction<(DocumentData | (DocumentData & { id: string; }))[], Student[]>'. I honestly never saw that before.

Ответить
@gosnooky
@gosnooky - 06.09.2023 06:23

This a great channel. I don't use Angular - never have, never will, but I do use NestJS quite often and it's "Angular-inspired" and uses RxJS under the hood. Sometimes I need to tap into their use of observables and I never understand RxJS very well, but these videos help.

Ответить
@florianfrank3618
@florianfrank3618 - 31.03.2023 12:43

Pleeease add returntypes to your methods 🥲

Ответить
@NickCarboneDrum
@NickCarboneDrum - 17.02.2023 16:45

Your communication skills are next level. Kudos and thank you! 🎉🎉🎉

Ответить
@olmanmora21
@olmanmora21 - 16.11.2022 22:43

This channel is a must-follow for any Angular Dev

Ответить
@Exiltruman
@Exiltruman - 02.09.2022 12:56

Great video, Joshua!
One thing though, in "watchClient" you could have used "filter" operator instead of "map" with "find".

Ответить
@sulsami
@sulsami - 01.09.2022 23:03

great video, thanks a lot <3

Ответить
@Kyumia
@Kyumia - 12.08.2022 12:46

For the people watching this almost a year later, Ben Lesh (RxJS dev) recommends using share({connector: new ReplaySubject(1)}) instead of shareReplay({bufferSize: 1, refCount: true}). It's the equivalent; the refCount is already set to true in the share() operator. The RxJS devs said they would probably deprecate shareReplay(1) in the future like the other multicasting operators such as: multicast, publish, publishReplay, publishLast, and refCount (already deprecated in RxJS 7). shareReplay still only exists due to its popularity and is now a wrapper around the highly configurable share operator. Source: Reactive Patterns with RxJS for Angular (e-Book)

Ответить
@buildmore9829
@buildmore9829 - 22.04.2022 21:45

Finally found someone who not just knows it deep but is able to explain it ! Thanks

Ответить
@CrusaderMen
@CrusaderMen - 02.02.2022 08:39

Thank you!

Ответить
@Asaloy
@Asaloy - 29.01.2022 23:08

You really should show it how it works with real data flowing and not just with showing code.

Ответить
@MrLolhaha100
@MrLolhaha100 - 11.12.2021 21:01

What if we have 2 different components? Say a list of clients, which upon clicking on a client name, it redirects to the client detail page. Will that still make use of the shareReplay observable and act like a centralised hub of data, akin to data management like ngrx? Thanks :)

Ответить
@sick911
@sick911 - 14.11.2021 18:59

Hi Joshua great video, a question about the check to see if you have clients, in a case where the request returns a subset of clients and need the next subset how would you do that?

Ответить
@lcho9871
@lcho9871 - 12.10.2021 19:25

If the getClients() only calls once, how often the collectionData (Firebase ?) will sync with the DB? Could that be configurable? Great stuffs and thanks.

Ответить
@BraveTravelerK
@BraveTravelerK - 11.10.2021 01:54

Really nice content and well explained, but I just got a few notes you might want to take into your next video:
- avoid implicit any as return-type for methods (eg. getclients() )
- maybe show the approach on how to build a ReplaySubject itself instead of an Observerable object
- import stricter linter rules

These are all optional but IMHO make the code alot more understandable/readable.

Ответить
@tanishqmanuja
@tanishqmanuja - 09.10.2021 08:42

Thanks for amazing content as usual . Can u also make a video explaining difference between behavioural subject vs replay subject vs share replay and the whats the best scenario to use them. Couldn't understand that because rxjs docs are not that good IMHO

Ответить
@lithixz
@lithixz - 08.10.2021 23:03

Thanks for providing that detailed insight.
Could you create a video on how to implement the updateClient methods etc. for that performant version as I am having my struggles on adapting to the other methods.

Ответить
@greatsuccess4734
@greatsuccess4734 - 07.10.2021 13:32

The way you explain the details is just awesome. Keep these rxjs videos coming. Thanks

Ответить
@sergioccarneiro
@sergioccarneiro - 07.10.2021 05:23

The refCount was the icing on the cake 👌

Ответить
@ksivasuriyaprakash9976
@ksivasuriyaprakash9976 - 06.10.2021 19:52

Thanks for sharing!

Ответить