Files
dashfront/src/automats/globalHistoryAutomat.js
2026-10-16 13:51:18 +02:00

27 lines
923 B
JavaScript

/**
* @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;