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

Ensure single subscription to Gate opening events #1315

Merged
merged 1 commit into from
Apr 1, 2023

Conversation

glopesdev
Copy link
Member

This PR fixes the behavior of the Gate operator to be consistent with common language patterns re. subscription. The Gate operator in Rx can be called either with a factory overload, where a new subscription is created for each gate trigger, or with a single subscription to an event sequence, where each notification triggers the gate.

The latter overload is more consistent with the rules of similar operators such as WindowTrigger. In general one can use the Defer operator if the former behavior is required. Alternatively, a new variant of the Gate operator can be exposed in the future which surfaces the factory overload through a nested operator.

Fixes #1206

@glopesdev glopesdev added the fix Pull request that fixes an issue label Apr 1, 2023
@glopesdev glopesdev added this to the 2.8 milestone Apr 1, 2023
@glopesdev glopesdev merged commit 606d6fe into bonsai-rx:main Apr 1, 2023
@glopesdev glopesdev deleted the issue-1206 branch April 1, 2023 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Pull request that fixes an issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gate operator default overload makes multiple subscriptions to the trigger sequence
1 participant