Skip to main content

warnOnce

还没翻译译自英文(tanstack.com)本页 15 段都还没译

function warnOnce(key, message): void;

Defined in: packages/db/src/utils.ts:410

Internal

Log a warning message only once per unique key. Subsequent calls with the same key will be silently ignored.

Used by first-party collection adapters.

Parameters

key

string

Unique identifier for this warning

message

string

The warning message to display

Returns

void

Example

// First call logs the warning
warnOnce('deprecated-api', 'This API is deprecated')

// Subsequent calls with same key are ignored
warnOnce('deprecated-api', 'This API is deprecated') // silent