warnOnLargeValues

function
diagnostics/warnOnLargeValues.ts:112
signature
warnOnLargeValues(store, limits): Unsubscribe

Warns, in development, when an event payload or a slice grows past a limit.

Parameters

NameTypeDescription
storeSizeWatchedStore
NameTypeDescription
limitsLargeValueLimits

Returns

Unsubscribe, A function that stops watching. In production it watches nothing and returns a no-op.

Example

example
if (import.meta.env.DEV) warnOnLargeValues(store, { maxSliceNodes: 20_000 });