mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-17 10:53:57 +01:00
20 lines
548 B
TypeScript
20 lines
548 B
TypeScript
import type { TankDefinition } from '@blitzkit/core';
|
|||
|
|
import { create } from 'zustand';
|
||
|
|
import { createContextualStore } from '../core/zustand/createContextualStore';
|
||
|
|
|
||
|
|
export interface GuessEphemeral {
|
||
|
|
tank: TankDefinition;
|
||
|
|
// true = correct, false = incorrect, null = not guessed
|
||
|
|
guessState: boolean | null;
|
||
|
|
totalSeen: number;
|
||
|
|
correct: number;
|
||
|
|
}
|
||
|
|
|
||
|
|
export const GuessEphemeral = createContextualStore((tank: TankDefinition) =>
|
||
|
|
create<GuessEphemeral>()(() => ({
|
||
|
|
tank,
|
||
|
|
guessState: null,
|
||
|
|
totalSeen: 0,
|
||
|
|
correct: 0,
|
||
|
|
})),
|
||
|
|
);
|