mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
21 lines
568 B
TypeScript
21 lines
568 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;
|
|
totalGuesses: number;
|
|
correctGuesses: number;
|
|
}
|
|
|
|
export const GuessEphemeral = createContextualStore((tank: TankDefinition) =>
|
|
create<GuessEphemeral>()(() => ({
|
|
tank,
|
|
guessState: null,
|
|
totalGuesses: 0,
|
|
correctGuesses: 0,
|
|
})),
|
|
);
|