2024-04-08 13:18:59 +03:00
|
|
|
import {
|
|
|
|
refreshableSettings,
|
|
|
|
createPersistedStore,
|
|
|
|
BasicTableSettings,
|
|
|
|
RefreshableTableSettings,
|
2025-08-04 17:10:46 +02:00
|
|
|
BackendPaginationTableSettings,
|
|
|
|
backendPaginationSettings,
|
2024-04-08 13:18:59 +03:00
|
|
|
} from '@@/datatables/types';
|
|
|
|
|
2025-08-04 17:10:46 +02:00
|
|
|
interface TableSettings
|
|
|
|
extends BasicTableSettings,
|
|
|
|
RefreshableTableSettings,
|
|
|
|
BackendPaginationTableSettings {}
|
2024-04-08 13:18:59 +03:00
|
|
|
|
|
|
|
export function createStore(storageKey: string) {
|
|
|
|
return createPersistedStore<TableSettings>(storageKey, undefined, (set) => ({
|
|
|
|
...refreshableSettings(set),
|
2025-08-04 17:10:46 +02:00
|
|
|
...backendPaginationSettings(set),
|
2024-04-08 13:18:59 +03:00
|
|
|
}));
|
|
|
|
}
|