SwrCache
Implementation of the SwrClient interface.
Query internally manages two categories:
Active: When there is one or more references or within the QueryOptions.keepAliveTime period
Inactive: When there are no references and past the QueryOptions.keepAliveTime period
Query in the Active state does not disappear from memory unless one of the following conditions is met:
removeQueries is explicitly called
On the other hand, Query in the Inactive state gradually disappears from memory when one of the following conditions is met:
Exceeds the maximum retention count of TimeBasedCache
Past the QueryOptions.gcTime period since saved in TimeBasedCache
gc is executed for unnecessary memory release
Mutation is managed similarly to Active state Query, but it is not explicitly deleted like removeQueries. Typically, since the result of Mutation execution is not reused, it does not cache after going inactive.
Properties
Provides a unified feedback mechanism for all Query/Mutation errors that occur within the client.
Note: This property is exposed for limited use cases where you may need to call MutationKey.mutate manually. It can be useful as an escape hatch or for synchronous invocations within the data layer.
Note: This property is exposed for limited use cases where you may need to call QueryKey.fetch and InfiniteQueryKey.fetch manually. It can be useful as an escape hatch or for synchronous invocations within the data layer.
Functions
Releases data in memory based on the specified level.
Gets the InfiniteQueryRef by the specified InfiniteQueryKey.
Retrieves data of the InfiniteQueryKey associated with the id.
Gets the MutationRef by the specified MutationKey.
Invalidates the queries by the specified InvalidateQueriesFilter.
Invalidates the queries by the specified UniqueId.
Executes side effects for queries.
Prefetches the infinite query by the specified InfiniteQueryKey.
Removes the queries by the specified RemoveQueriesFilter.
Removes the queries by the specified UniqueId.
Resumes the queries by the specified ResumeQueriesFilter.
Resumes the queries by the specified UniqueId.
Updates the data of the InfiniteQueryKey associated with the id.