mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: progress on tankopedia search
This commit is contained in:
1 parent
36583add1d
commit
c873c32d09
10 files changed
+62
-71
No files matched your search
@@ -1,6 +1,5 @@
|
||||
import { TankClass, Tier, TreeType } from '@blitzkit/core';
|
||||
import { create } from 'zustand';
|
||||
import { createContextualSafeStore } from '../core/zustand/createContextualSafeStore';
|
||||
import type { TankClass, Tier, TreeType } from '@blitzkit/core';
|
||||
import { map } from 'nanostores';
|
||||
|
||||
export interface TankFilters {
|
||||
tiers: Tier[];
|
||||
@@ -12,15 +11,12 @@ export interface TankFilters {
|
||||
searching: boolean;
|
||||
}
|
||||
|
||||
export const { Provider, use, useMutation, useStore } =
|
||||
createContextualSafeStore(() =>
|
||||
create<TankFilters>()(() => ({
|
||||
tiers: [],
|
||||
nations: [],
|
||||
classes: [],
|
||||
types: [],
|
||||
testing: 'include',
|
||||
search: undefined,
|
||||
searching: false,
|
||||
})),
|
||||
);
|
||||
export const $tankFilters = map<TankFilters>({
|
||||
tiers: [],
|
||||
nations: [],
|
||||
classes: [],
|
||||
types: [],
|
||||
testing: 'include',
|
||||
search: undefined,
|
||||
searching: false,
|
||||
});
|
||||
@@ -1,6 +1,5 @@
|
||||
import { create } from 'zustand';
|
||||
import { createContextualSafeStore } from '../core/zustand/createContextualSafeStore';
|
||||
import {
|
||||
import { map } from 'nanostores';
|
||||
import type {
|
||||
TankopediaSortBy,
|
||||
TankopediaSortDirection,
|
||||
} from './tankopediaPersistent';
|
||||
@@ -10,10 +9,7 @@ export interface TankopediaSort {
|
||||
direction: TankopediaSortDirection;
|
||||
}
|
||||
|
||||
export const { Provider, use, useMutation, useStore } =
|
||||
createContextualSafeStore(() =>
|
||||
create<TankopediaSort>()(() => ({
|
||||
by: 'meta.none',
|
||||
direction: 'descending',
|
||||
})),
|
||||
);
|
||||
export const $tankopediaSort = map<TankopediaSort>({
|
||||
by: 'meta.none',
|
||||
direction: 'descending',
|
||||
});
|
||||
Reference in new issue
Block a user