-
Notifications
You must be signed in to change notification settings - Fork 150
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
Why is the work only replaying the last value? #156
Comments
Yes; if we replayed all values, the memory use would grow forever as more executions are called. Rather than replay an arbitrary number of elements, we use 1 (which is necessary to compute internal state, if I recall correctly). Let me know what I can clarify. |
Understood. I wonder if it would be better to not replay anything at all in this case and calculate the state differently. Because one may incorrectly assume that only one value got sent. |
Yeah, I can see why you'd get that impression from reading the code. From the outside perspective, I think our API contract adheres to RxSwift norms. You wouldn't normally expect to get all values from a stream when you subscribe to it, but having the current value (that is to say, subscribing to the observable and doing stuff with it right away) is often useful. Let me know what I can clarify here 👍 |
@ashfurrow @c0diq Should we remove implicit replay latest value and leave developer to decide if they need to? |
I think we need the last value, if an existing Action gets assigned to |
@ashfurrow I see now we only need |
In Action.swift, only the last value emitted by work factory is being replayed. Is it intentional?
This have the side effect that trying to share the last execution, only the last value is being replayed.
The text was updated successfully, but these errors were encountered: