mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: page turner
This commit is contained in:
1 parent
579d7570af
commit
c5e1a7d6ab
8 files changed
+322
-144
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import { produce } from 'immer';
|
||||
import { create } from 'zustand';
|
||||
import { devtools, persist } from 'zustand/middleware';
|
||||
|
||||
export type TankopediaSortBy = 'tier';
|
||||
export type TankopediaSortDirection = 'ascending' | 'descending';
|
||||
|
||||
type Tankopedia = {
|
||||
sortBy: TankopediaSortBy;
|
||||
sortDirection: TankopediaSortDirection;
|
||||
};
|
||||
|
||||
export const useTankopedia = create<Tankopedia>()(
|
||||
devtools(
|
||||
persist(
|
||||
(set) => ({
|
||||
sortBy: 'tier',
|
||||
sortDirection: 'descending',
|
||||
}),
|
||||
{ name: 'tankopedia' },
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
export default function mutateTankopedia(recipe: (draft: Tankopedia) => void) {
|
||||
useTankopedia.setState(produce(recipe));
|
||||
}
|
||||
Reference in new issue
Block a user