CompactOptions
Type Stability: stable
Related guide: Persistence and sync →
Definition
TypeScript
import type { CompactOptions } from '@aionbuilders/nabu';TypeScript
interface CompactOptions {
onBeforeCompact?: (fullSnapshot: Uint8Array) => void | Promise<void>;
retain: string | number;
}Properties
| Property | Type | Description |
|---|---|---|
onBeforeCompactoptional | (fullSnapshot: Uint8Array) => void | Promise<void> | awaited with the COMPLETE snapshot (all the history) before anything is dropped; archive it. If it throws / rejects the compaction is ABORTED and nothing is lost. |
retain | string | number | how much PAST history survives: a duration in ms, or a string |
Source: src/lib/persistence/history.js:11