Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Resource<T, Params>

An interface for data-fetching resources to be used for Suspense-wrapped components.

Type parameters

Hierarchy

  • Resource

Index

Properties

Properties

mutate

mutate: (value: T, ...params: Params) => void

Mutates the cache value from both the resource cache and the global cache.

Type declaration

    • (value: T, ...params: Params): void
    • Parameters

      • value: T
      • Rest ...params: Params

      Returns void

read

read: (...params: Params) => T | undefined

Declarative resource reading. Used by the data-fetching components.

if the Config's revalidateOnVisibility is set to true, it causes all of the components with shared requests to opt to fallback for the resource revalidation when the page gets visible again.

if the Config's updateOnVisibility is set to true, it causes all of the components to re-render again.

Type declaration

    • (...params: Params): T | undefined
    • Parameters

      • Rest ...params: Params

      Returns T | undefined

trigger

trigger: (...params: Params) => void

Triggers a cache revalidation for the resource.

Type declaration

    • (...params: Params): void
    • Parameters

      • Rest ...params: Params

      Returns void

Generated using TypeDoc