Skip to content

Add useSWRImmutable helper hook #60

@b1rdex

Description

@b1rdex

Some resources are immutable (or app should not revalidate their contents).

For now, I have to use it like this:

const { data: itemInfoData } = client.users.list.useSWR(
  {some: "params"},
  {
    revalidateIfStale: false,
    revalidateOnFocus: false,
    revalidateOnReconnect: false,
  },
);

Using the original SWR this could be simplified to

const { data: itemInfoData } = client.users.list.useSWRImmutable({some: 'params'});

Please consider adding this simple helper hook.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions