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

Introduce Subscription Filters #138

Merged
merged 1 commit into from
Nov 30, 2024
Merged

Conversation

ogaclejapan
Copy link
Contributor

This PR extends the Subscription API to allow invoking side effects, similar to the Query API. With this enhancement, the following functionalities are now supported:

Filter execution upon network reconnection:

  • SubscriptionOptions#restartOnReconnect
  • SwrCachePlusPolicy#networkResumeSubscriptionsFilter

Filter execution upon a window refocused:

  • SubscriptionOptions#restartOnFocus
  • SwrCachePlusPolicy#windowResumeSubscriptionsFilter

Triggering side effects via SwrClient:

  • SwrClient#effect

Triggering side effects upon a successful mutation:

  • MutationKey#onMutateEffect

This PR extends the Subscription API to allow invoking side effects, similar to the Query API. With this enhancement,
the following functionalities are now supported:

Filter execution upon network reconnection:

* `SubscriptionOptions#restartOnReconnect`
* `SwrCachePlusPolicy#networkResumeSubscriptionsFilter`

Filter execution upon window refocus:

* `SubscriptionOptions#restartOnFocus`
* `SwrCachePlusPolicy#windowResumeSubscriptionsFilter`

Triggering side effects via SwrClient:

* `SwrClient#effect`

Triggering side effects upon successful mutation:

* `MutationKey#onMutateEffect`
@ogaclejapan ogaclejapan added the enhancement New feature or request label Nov 30, 2024
@ogaclejapan ogaclejapan merged commit 1e7d94b into main Nov 30, 2024
3 checks passed
@ogaclejapan ogaclejapan deleted the introduce-subscription-filters branch November 30, 2024 08:11
@github-actions github-actions bot mentioned this pull request Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant