I've been trying to learn RxJS and transform some of the stuff I did before to RxJS. I also have some questions overall about code quality and best practices.
Suppose I have these type definitions: image1 (char limit 😢 )
Here I wanted to ask which is considered better practice for limiting inputs to functions: type or const enum, both have intellisense but I find type solution better since I have
('name1', 'name2') instead of (CodebookNames.name1, CodebookNames.name2), less verbose.
Currently my sevice is this: image2 and image3
I have serval questions:
- I suppose for local values i don't even need ReplaySubject i could do everything with only last variable. Would this be considered good?
- I don't know how to make typescript believe I always either have codebooksHere$, codebooksFetching$ or both (since i have minimum of 1 parameter input). I need to use ! operator on my returns.
- I tried a lot of operators but got nothing working except combineLatestWith, a lot of them say the will bi depracated in v8. What I want to do is that if I have both local and fetching codebooks first send only locals, but after fetching ones are fetched I want to send a new combined object of both local and fetched ones.