Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/framework/react/guides/filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,16 @@ const isMatching = matchMutation(filters, mutation)
```

Returns a boolean that indicates whether a mutation matches the provided set of mutation filters.

### `partialMatchKey`

```tsx
const isPartialMatch = partialMatchKey(keyA, keyB)
```

Determines whether the query key `keyB` partially matches the query key `keyA` and returns a boolean.

Use Cases:

- Filtering queries based on partial match of query keys.
- Checking if a query key is a subset of another query key, to perform the required logic.
1 change: 1 addition & 0 deletions packages/query-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export {
replaceEqualDeep,
isServer,
matchQuery,
partialMatchKey,
matchMutation,
keepPreviousData,
skipToken,
Expand Down