mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-12-05 07:43:49 +01:00
17 lines
489 B
TypeScript
17 lines
489 B
TypeScript
import { produce } from 'immer';
|
|||
|
|
import { create } from 'zustand';
|
||
|
|
import { TankopediaSortBy, TankopediaSortDirection } from './tankopedia';
|
||
|
|
|
||
|
|
export interface TankopediaSort {
|
||
|
|
by: TankopediaSortBy;
|
||
|
|
direction: TankopediaSortDirection;
|
||
|
|
}
|
||
|
|
|
||
|
|
export const useTankopediaSort = create<TankopediaSort>()(() => ({
|
||
|
|
by: 'meta.none',
|
||
|
|
direction: 'descending',
|
||
|
|
}));
|
||
|
|
|
||
|
|
export function mutateTankopediaSort(recipe: (draft: TankopediaSort) => void) {
|
||
|
|
useTankopediaSort.setState(produce(recipe));
|
||
|
|
}
|