Skip to content

Commit

Permalink
fixup! refactor(core): add reusable rxSwr operator
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoerge committed Sep 30, 2024
1 parent 8c69fa6 commit 2ce3dc0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/sanity/src/core/util/rxSwr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ interface SWRCache<T> {

const createSWRCache = createLRUCache

/**
* @internal
* @param options - Options for the SWR operator
*/
export function createSWR<T>(options: {maxSize: number}) {
const cache = createSWRCache<T>(options)
return function rxSwr(key: string): OperatorFunction<T, {fromCache: boolean; value: T}> {
Expand Down

0 comments on commit 2ce3dc0

Please sign in to comment.