/** * @file globalHistoryAutomat.js * @description Double-buffered chunk list automat (`globalHistoryAutomat`) for * global system and change history logs with multi-filter caching and LRU eviction. * * Upstream Triggers: * - `authAutomat`: Subscribes to auth state changes — resets on `'anon'` or when * `selectedCompanyId` changes. * - Consumer UI: Calls `getItems()`, `requireChunk(start, end)`, `filter(search)`, * `addSeekMonth()`, `addSeekYear()`, `resetNegativeSeek()`. */ import { createChunkListAutomat } from './createChunkListAutomat'; import { globalHistory } from '../api'; export const globalHistoryAutomat = createChunkListAutomat({ name: 'globalHistory', chunkSize: 50, maxLruChunks: 50, fetchPage: (params) => globalHistory.list(params), }); // Alias for backwards compatibility export const globalHistoryGridAutomat = globalHistoryAutomat; export default globalHistoryAutomat;