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

feat(query): add callback for rollback of mutation on query cache #2619

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

odinr
Copy link
Collaborator

@odinr odinr commented Dec 2, 2024

Why

Allow rollback of cache setting.
When calling mutate the query will return a callback function which will set the state back to before the mutation happend

closes:

Check off the following:

  • Confirm that I checked changes to branch which I am merging into.

    • I have validated included files
    • My code does not generate new linting warnings
    • My PR is not a duplicate, check existing pr`s
  • Confirm that the I have completed the self-review checklist.

  • Confirm that my changes meet our code of conduct.

@odinr odinr requested a review from a team as a code owner December 2, 2024 15:15
Copy link

changeset-bot bot commented Dec 2, 2024

🦋 Changeset detected

Latest commit: 2a1f045

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 23 packages
Name Type
@equinor/fusion-query Minor
@equinor/fusion-framework-module-app Patch
@equinor/fusion-framework-module-bookmark Patch
@equinor/fusion-framework-module-context Patch
@equinor/fusion-framework-module-service-discovery Patch
@equinor/fusion-framework-module-widget Patch
@equinor/fusion-framework-react-components-people-provider Patch
@equinor/fusion-framework-react-module-context Patch
@equinor/fusion-framework-app Patch
@equinor/fusion-framework-react-app Patch
@equinor/fusion-framework-react-components-bookmark Patch
@equinor/fusion-framework-react Patch
@equinor/fusion-framework-legacy-interopt Patch
poc-portal Patch
@equinor/fusion-framework-react-module-bookmark Patch
@equinor/fusion-framework Patch
@equinor/fusion-framework-module-signalr Patch
@equinor/fusion-framework-react-widget Patch
@equinor/fusion-framework-widget Patch
@equinor/fusion-framework-cookbook-app-react-context-custom-error Patch
@equinor/fusion-framework-cookbook-app-react-context Patch
@equinor/fusion-framework-cookbook-app-react-feature-flag Patch
@equinor/fusion-framework-react-module-signalr Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@odinr odinr self-assigned this Dec 2, 2024
@github-actions github-actions bot added 🚀 feature New feature or request 🛠️ utils packages related to utils labels Dec 2, 2024
Copy link
Contributor

github-actions bot commented Dec 2, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 0.39% 1751 / 444440
🔵 Statements 0.39% 1751 / 444440
🔵 Functions 22.93% 203 / 885
🔵 Branches 37.1% 384 / 1035
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/utils/query/src/Query.ts 94.92% 90.12% 80% 94.92% 200-201, 211, 340-341, 374, 388, 672-673, 687-691, 781-783
packages/utils/query/src/cache/QueryCache.ts 81.53% 70.58% 71.42% 81.53% 80-81, 120-121, 144-145, 156-157, 163-164, 170-171
packages/utils/query/src/cache/actions.ts 88.57% 100% 100% 88.57% 22, 81-83
packages/utils/query/src/cache/create-reducer.ts 68.23% 88.88% 50% 68.23% 13-14, 31-32, 59, 86-115
Generated in workflow #8124 for commit 2a1f045 by the Vitest Coverage Report Action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 feature New feature or request 🛠️ utils packages related to utils
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants