-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scan/Min/Max transformer may has side effect leaking #74
Comments
Hrm, good catch. I'd personally like to keep the transformers Public, as that allows folks to use all of our Stream and StreamTransformers classes individually without needing to pull in all of Observable if they really only need one or two items. In this case, great call. We should inspect our operators and make sure they can be reused. Secondly, we defo need more docs on these classes. We've just made them public without much explanation thus far, something we'll certainly fix :) |
hmmm, we could fix this by storing values in a Map for example, take the min/max transformer, instead of storing a single On close, we could delete the related |
Another option: Now that we've got a class with an internal factory method, every time Although I think we should generally review our transformers and see if we can avoid doing that, for some cases it might make sense to ensure we don't have state problems. |
Considering I have such code:
I may dirty the intermedia result of scan transformer.
Given the transforms are public, if I only want to reuse the transforms without using the Observable interface, and according to "It is good practice to write transformers that can be used multiple times.". I may want to use transformer like that.
How about either mark transformers private, or document them/add annotations to indicate that these transformers is not sharable.
The text was updated successfully, but these errors were encountered: