DB Docs
API Reference
- Core API Reference
- Collection
- createCollection
- liveQueryCollectionOptions
- createLiveQueryCollection
- createOptimisticAction
- createTransaction
- Electric DB Collection
- electricCollectionOptions
- Query DB Collection
- queryCollectionOptions
- RxDB DB Collection
- rxdbCollectionOptions
- PowerSync Collection
- powerSyncCollectionOptions
- createIndexedDB
- indexedDBCollectionOptions
- React Hooks
- useLiveQuery
AI/LLM: This documentation page is available in plain markdown format at/db/latest/docs/reference/functions/warnOnce.md
warnOnce
ts
function warnOnce(key, message): void;Defined in: packages/db/src/utils.ts:434
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#
ts
// 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