hashKey
TypeScript
1function hashKey(queryKey: readonly unknown[]): string;定义于:packages/query-core/src/utils.ts:323
查询与修改的默认键哈希函数。
将值哈希为一个稳定哈希。
参数
queryKey
readonly unknown[]
待哈希的查询键或修改键。
返回值
string
该键的稳定哈希,以 JSON 字符串形式返回。
示例
TypeScript
1// Object keys are sorted, so key order doesn't affect the hash:2hashKey(['todos', { page: 1, filter: 'done' }]) // === '["todos",{"filter":"done","page":1}]'