Sign in
Log inSign up
Alexey Karpov

82 likes

·

12.1K reads

6 comments

Umair Hafeez
Umair Hafeez
Aug 18, 2022

This is brilliantly put together. Thank you for sharing Alexey Karpov!

1
·
danial Vafadar
danial Vafadar
Sep 24, 2022

Nice work but I have a question about the facade layer as you mentioned you subscribe to your subject in order to make sure that fresh data is available inside the subject but what about destroying that subscription doesn't it create a memory leak because whenever we call the facade method it will create a subscription and that subscription will always be on the memory how to handle this case?

1
·
·1 reply
Alexey Karpov
Alexey Karpov
Author
·Feb 4, 2023

Hi, I’m sorry for the very late answer. That’s a good question. In general case such subscription should be treated with extra care, e.g. we always need to precisely know when to unsubscribe. In this case I have an observable that emits only 1 value, when HTTP request is done. Essentially this facade says “no matter what, the request shouldn’t be cancelled”. I don’t apply this same solutions to all the components and facades. Whenever it’s possible, I subscribe as close to the data rendering as possible, ideally in the HTML template.

·
saeed baghestani
saeed baghestani
Jun 22, 2023

This article was very helpful for me, of course I am new to this field and need to spend more time learning and experiencing to be able to give a better opinion and along the way I hope to use your knowledge.

1
·
Chibuzo Odigbo
Chibuzo Odigbo
Jul 26, 2022

Impacting. Do you have any work on the full implementation of todos, it's dos and don'ts in react?

·
John Tarus
John Tarus
Jul 28, 2022

cool piece.

·