mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-15 21:56:10 +01:00
feat: cleaner filters
This commit is contained in:
1 parent
b804e60bac
commit
84a1af8100
5 files changed
+388
-185
No files matched your search
+13
-21
@@ -1,6 +1,5 @@
|
||||
import { produce } from 'immer';
|
||||
import { create } from 'zustand';
|
||||
import { devtools, persist } from 'zustand/middleware';
|
||||
import { TankType, TreeTypeString } from '../components/Tanks';
|
||||
import { Tier } from '../core/blitzkrieg/definitions/tanks';
|
||||
|
||||
@@ -22,26 +21,19 @@ type Tankopedia = {
|
||||
};
|
||||
};
|
||||
|
||||
export const useTankopedia = create<Tankopedia>()(
|
||||
devtools(
|
||||
persist(
|
||||
(set) => ({
|
||||
sort: {
|
||||
by: 'tier',
|
||||
direction: 'descending',
|
||||
},
|
||||
filters: {
|
||||
tiers: [],
|
||||
types: [],
|
||||
treeTypes: [],
|
||||
nations: [],
|
||||
test: 'include',
|
||||
},
|
||||
}),
|
||||
{ name: 'tankopedia' },
|
||||
),
|
||||
),
|
||||
);
|
||||
export const useTankopedia = create<Tankopedia>()(() => ({
|
||||
sort: {
|
||||
by: 'tier',
|
||||
direction: 'descending',
|
||||
},
|
||||
filters: {
|
||||
tiers: [],
|
||||
types: [],
|
||||
treeTypes: [],
|
||||
nations: [],
|
||||
test: 'include',
|
||||
},
|
||||
}));
|
||||
|
||||
export default function mutateTankopedia(recipe: (draft: Tankopedia) => void) {
|
||||
useTankopedia.setState(produce(recipe));
|
||||
|
||||
Reference in new issue
Block a user