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

Add extension function on observable to ignore OnComplete events #1135

Merged
merged 3 commits into from
Jul 8, 2024

Conversation

helto4real
Copy link
Collaborator

@helto4real helto4real commented Jul 8, 2024

Breaking change

Proposed change

Type of change

In certain scenarios we might want to make sure the action is not called if the underlying Observable completes. For example advanced usages of Throttle you may want to make sure it never calls the action when an application is restarted. For most cases the extension method WhenStateIsFor should be used that are safe for this reason but if the user still wants to use Throttle for some reason and do not want it call the action prematurely before the timeout is due, this new method can be used before the Throttle.

Example:

ha.StateChanges()
  .Where(...)
  .IgnoreOnComplete()
  .Throttle(...)
  .Subscribe(...);
  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • The code compiles without warnings (code quality check)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration are added/changed:

@helto4real helto4real enabled auto-merge (squash) July 8, 2024 15:30
Copy link

codecov bot commented Jul 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81%. Comparing base (11db230) to head (20ad5af).

Additional details and impacted files
@@         Coverage Diff          @@
##           main   #1135   +/-   ##
====================================
  Coverage    81%     81%           
====================================
  Files       190     190           
  Lines      3889    3890    +1     
  Branches    478     478           
====================================
+ Hits       3182    3183    +1     
  Misses      523     523           
  Partials    184     184           
Flag Coverage Δ
unittests 81% <100%> (+<1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@helto4real helto4real merged commit 0315ea1 into main Jul 8, 2024
7 checks passed
@helto4real helto4real deleted the Fix-throttle-problem branch July 8, 2024 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants