Skip to content
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

rx: allow client control of reduce accumulator #231

Closed
Tracked by #122
plastikfan opened this issue Apr 17, 2024 · 0 comments · Fixed by #237
Closed
Tracked by #122

rx: allow client control of reduce accumulator #231

plastikfan opened this issue Apr 17, 2024 · 0 comments · Fixed by #237
Assignees
Labels
bug Something isn't working

Comments

@plastikfan
Copy link
Contributor

plastikfan commented Apr 17, 2024

The accumulator needs to be more flexible so that it can work correctly with the Range operator and Sum. The problem at the moment is to do with how the accumultaor is initialised. When the range operator is in play, the items in the observable are generated by an in based for loop. This means that we have to use a Num instance of Item[T]. But, that means the accumulator must also initialised with a Num. But doing this breaks the Sum operator which works on native instances of Item and means Item[T].V is in place because the opaque field is un-set (remains as nil; can't be initialised to 0). The client should have more control over the accumulator.

As I write this, it occurs to me that the Range operator could be improved to not just work with Num instances of Item[T]; this should be addressed in another issue (#232), which should be implemented first before this one.

@plastikfan plastikfan mentioned this issue Apr 17, 2024
59 tasks
@plastikfan plastikfan self-assigned this Apr 17, 2024
@plastikfan plastikfan added the bug Something isn't working label Apr 17, 2024
@plastikfan plastikfan linked a pull request Apr 24, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant