Documentation idea: label operators as either lossless or potentially lossy #7469
Replies: 2 comments 1 reply
-
To add some context, I've been using RxJS for building reporting and ETL batch scripts where I need to ensure all data is processed and it'd be nice to quickly rule out operators which are lossy and focus on lossless operators. |
Beta Was this translation helpful? Give feedback.
-
Hi @curiousercreative, thank you for sharing your idea with us. I am in favor of adding and improving our docs a lot, but we have to do it very carefully. Marking operators as lossy or lossless is much harder for some operators as there are operators that can be both lossy and lossless. For example, The list of such operators is huge. How would we mark such operators? Also, what about docs? How terms lossy and lossless could be described in docs when someone sees them? |
Beta Was this translation helpful? Give feedback.
-
I'm no wiz with RxJS still, but over the years I've struggled to wrap my head around the various operators. We have great tools in the marble diagrams and the operator decision tree, but one dimension that could be more succinctly documented is whether an operator is potentially lossy or not. Take, debounce, throttle, filter are some examples of operators that may output fewer values than taken as input. On the contrary, the various maps, tap, and others will always output the same number of values as they are input (over time).
Anecdotally, I was in need of a lossless operator to comply with an API service's rate limit and it took me awhile to rule out the various operators (they are all lossy) before I rolled my own: https://github.com/curiousercreative/rxjs-rate-limit
If there's interest, I'd recommend discussing further:
Beta Was this translation helpful? Give feedback.
All reactions