frontPanel/src/stores/questions/store.ts

23 lines
521 B
TypeScript
Raw Normal View History

2023-11-14 16:44:27 +00:00
import { Question } from "@model/question/question";
import { create } from "zustand";
import { devtools } from "zustand/middleware";
export type QuestionsStore = {
questionsById: Record<number, Question | undefined>;
};
const initialState: QuestionsStore = {
questionsById: {},
};
export const useQuestionsStore = create<QuestionsStore>()(
devtools(
() => initialState,
{
name: "QuestionsStore",
enabled: process.env.NODE_ENV === "development",
}
)
);