0.0.40
- Added opt-in debug logging per cache (
enableDebugLogging
config) as well as globally (enableDebugLogging
export) for development builds. - Add (DEV-only) warning to
createIntervalCache
andcreateStreamingCache
for non-unique cache keys– specifically warning about the key containing anObject
case as a string.
Debug logging
In development mode, "suspense" can be configured to log timing information. Logging can be enabled/disabled per cache:
import { createCache } from "suspense";
// Cache can be configured during initialization
const cache = createCache({
debugLogging: true,
load,
});
// They can also be turned on/off later
cache.disableDebugLogging();
cache.enableDebugLogging();
It can also be done globally (for all caches).
import { disableDebugLogging, enableDebugLogging } from "suspense";
// Turns debug logging on for all caches
enableDebugLogging();
// Turns debug logging off for all caches
disableDebugLogging();