mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
feat: use max stage
This commit is contained in:
1 parent
56ca4dcc61
commit
db6d181f78
2 files changed
+5
-3
No files matched your search
@@ -18,6 +18,8 @@ export function Page({ id }: { id: string }) {
|
||||
function Content({ id }: { id: string }) {
|
||||
const tank = useAwait(() => api.tank(id), `tank-${id}`);
|
||||
|
||||
Tankopedia.useInitialization(tank.upgrade_stages.length);
|
||||
|
||||
const protagonist = Tankopedia.use((state) => state.protagonist);
|
||||
const parameters = useMemo(
|
||||
() =>
|
||||
|
||||
@@ -5,6 +5,6 @@ interface Tankopedia {
|
||||
protagonist: TankState;
|
||||
}
|
||||
|
||||
export const Tankopedia = new Varuna<Tankopedia>({
|
||||
protagonist: { stage: 0, shell: 0 },
|
||||
});
|
||||
export const Tankopedia = new Varuna<Tankopedia, number>((maxStage) => ({
|
||||
protagonist: { stage: maxStage, shell: 0 },
|
||||
}));
|
||||
Reference in new issue
Block a user