27 lines
925 B
JavaScript
27 lines
925 B
JavaScript
/**
|
|
* @file articleHistoryAutomat.js
|
|
* @description Double-buffered chunk list automat (`articleHistoryAutomat`) for
|
|
* article audit logs and history entries 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 { article } from '../api';
|
|
|
|
export const articleHistoryAutomat = createChunkListAutomat({
|
|
name: 'articleHistory',
|
|
chunkSize: 50,
|
|
maxLruChunks: 50,
|
|
fetchPage: (params) => article.getHistory(params),
|
|
});
|
|
|
|
// Alias for backwards compatibility
|
|
export const articleHistoryGridAutomat = articleHistoryAutomat;
|
|
|
|
export default articleHistoryAutomat;
|