2024-09-17 21:44:36 -05:00
|
|
|
import { create } from 'zustand';
|
|
|
|
|
import { createContextualSafeStore } from '../core/zustand/createContextualSafeStore';
|
|
|
|
|
import {
|
2024-07-09 14:43:33 -05:00
|
|
|
TankopediaSortBy,
|
|
|
|
|
TankopediaSortDirection,
|
|
|
|
|
} from './tankopediaPersistent';
|
2024-07-02 19:19:15 -05:00
|
|
|
|
|
|
|
|
export interface TankopediaSort {
|
|
|
|
|
by: TankopediaSortBy;
|
|
|
|
|
direction: TankopediaSortDirection;
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-17 21:44:36 -05:00
|
|
|
export const { Provider, use, useMutation, useStore } =
|
|
|
|
|
createContextualSafeStore(() =>
|
|
|
|
|
create<TankopediaSort>()(() => ({
|
|
|
|
|
by: 'meta.none',
|
|
|
|
|
direction: 'descending',
|
|
|
|
|
})),
|
|
|
|
|
);
|