Skip to content

Commit 51e627f

Browse files
authored
refactor(query-persist-client-core/createPersister): rename the 'filters' option to 'persistFilters' internally to avoid shadowing (#12290)
1 parent 16f7d4c commit 51e627f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎packages/query-persist-client-core/src/createPersister.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export function experimental_createQueryPersister<TStorageValue = string>({
146146
>['deserialize'],
147147
prefix = PERSISTER_KEY_PREFIX,
148148
refetchOnRestore = true,
149-
filters,
149+
filters: persistFilters,
150150
}: StoragePersisterOptions<TStorageValue>) {
151151
/**
152152
* Checks whether a persisted query should be discarded.
@@ -280,7 +280,9 @@ export function experimental_createQueryPersister<TStorageValue = string>({
280280
ctx: QueryFunctionContext<TQueryKey>,
281281
query: Query,
282282
) {
283-
const matchesFilter = filters ? matchQuery(filters, query) : true
283+
const matchesFilter = persistFilters
284+
? matchQuery(persistFilters, query)
285+
: true
284286

285287
// Try to restore only if we do not have any data in the cache and we have persister defined
286288
if (matchesFilter && query.state.data === undefined && storage != null) {

0 commit comments

Comments
 (0)