Skip to main content
Version: v8.0.0

getShouldClearState

Determines whether state should be cleared when the cache key changes.

"clean" — always clear

"preserve" — never clear

"auto" — clear when the resource identity changed (URL params), preserve when only query params changed


Import
import { getShouldClearState } from "@hyper-fetch/react"

Parameters

getShouldClearState(mode: auto | preserve | clean, oldCacheKey: string, newCacheKey: string)
Parameters
NameTypeDescription
mode
auto | preserve | clean
oldCacheKey
string
newCacheKey
string

Returns

boolean