[Docs]: add best practice guide #6341
Replies: 17 comments
-
@jwo719 is wonderful! I suggest adding the article https://medium.com/p/92502d5639d0 to explain handling subscribe-unsubscribe |
Beta Was this translation helpful? Give feedback.
-
that's a pretty extensive blog. Thanks for sharing it. It's a little bit too Angular-heavy but there are definitely some points, we should cover in an official best practices recommendation |
Beta Was this translation helpful? Give feedback.
-
The section should clarify what .subscribe does. It ends composability. Subscribe starts a process and/or is here to perform a side effect. If people want to compose the values further they should not subscribe. Even if it a very essential basic practice shows this is not clear. |
Beta Was this translation helpful? Give feedback.
-
Error handling should also be implemented |
Beta Was this translation helpful? Give feedback.
-
Build own operators (i know that rxjs docs already have it but that could be a good point for best practice guide) The general rule is for takeUntil to be placed last (Avoiding takeUntil Leaks) |
Beta Was this translation helpful? Give feedback.
-
Cover testing as well please, the marble tests can be tricky sometimes. I'd like to see more examples of more complex scenarios. |
Beta Was this translation helpful? Give feedback.
-
I think @cartant 's rxjs-tslint-rules should be mentioned as well. |
Beta Was this translation helpful? Give feedback.
-
Hi @jwo719 |
Beta Was this translation helpful? Give feedback.
-
As far as I know there is no official best practices page in the docs, and I would love to create one, using both my experience with the library (I've written several articles on both good approaches and incorporating RxJS in Angular, see: this, this and this one) and the advice shared by contributors in this thread. Is there anything that could block me? What is a good starting point? Any insight on how that page will be located and what it could look like, also, how much creative freedom can I have if we choose to go forward with it? |
Beta Was this translation helpful? Give feedback.
-
@Armenvardanyan95 I can contribute on this also |
Beta Was this translation helpful? Give feedback.
-
@lamisChebbi thank you. I have created a markdown file where I have written some introductory stuff. I can create a separate repo with it, until we understand how we proceed with that doc inside RxJS docs |
Beta Was this translation helpful? Give feedback.
-
hi @Armenvardanyan95 & @lamisChebbi please feel free to make suggestions for such a page. It would basically require a seperate md document in the docs_app project and an adjustment in the navigation.json file to make your changes reflect in the navigation menu. |
Beta Was this translation helpful? Give feedback.
-
@niklas-wortmann thanks a lot. I have started working on an md file, I will continue working on an initial version of it for a day or two and then submit a pr, then we can probably discuss it more concretely. As of now I don't have specific questions, there is lots of thoughts in this very thread I can use as guidance, we will see then how it goes |
Beta Was this translation helpful? Give feedback.
-
@niklas-wortmann Although upon re-reading this thread I have q question. You mentioned in the very first comment "don't subclass", do you mean that we should not subclass |
Beta Was this translation helpful? Give feedback.
-
yeah that's exactly what I meant. We came around this issue a couple of times, here's one reference I found quickly: The problem is basically, that it is quite easy to shoot yourself in the foot and it might break when we do changes to those classes as there are very tightly coupled this way |
Beta Was this translation helpful? Give feedback.
-
Thank you. I will add that to the doc |
Beta Was this translation helpful? Give feedback.
-
@lamisChebbi @niklas-wortmann I submitted an initial PR, would be happy to continue discussion there and hear opinions on how it can be improved |
Beta Was this translation helpful? Give feedback.
-
In the last core meeting, we came up, that we want to have an official recommendation within the official docs. It should include:
I'm very open to any kind of suggestion, so please let me know about anything you could think of.
Beta Was this translation helpful? Give feedback.
All reactions