CachedResource

A cached resource.

Example

{
  data: { name: 'John Doe' },
  status: 'idle',
  error: null,
  mutate: (newData: User) => void,
  invalidate: () => void,
}

Members

data :Signal.<(T|undefined)>

The data for the cached resource.

Type:
  • Signal.<(T|undefined)>

error :Signal.<unknown>

The error for the cached resource.

Type:
  • Signal.<unknown>

invalidate :function

The function to invalidate the cached resource.

Type:
  • function

mutate :function

The function to mutate the cached resource.

Type:
  • function

status :Signal.<('idle'|'loading'|'revalidating'|'error'|'success')>

The status of the cached resource.

Type:
  • Signal.<('idle'|'loading'|'revalidating'|'error'|'success')>