frontPanel/src/stores/questions/store.ts
2023-11-14 23:15:52 +03:00

23 lines
538 B
TypeScript

import { AnyQuizQuestion } from "@model/questionTypes/shared";
import { create } from "zustand";
import { devtools } from "zustand/middleware";
export type QuestionsStore = {
questionsById: Record<number, AnyQuizQuestion | undefined>;
};
const initialState: QuestionsStore = {
questionsById: {},
};
export const useQuestionsStore = create<QuestionsStore>()(
devtools(
() => initialState,
{
name: "QuestionsStore",
enabled: process.env.NODE_ENV === "development",
}
)
);