moodist/src/stores/alarm.ts
2024-08-30 23:35:58 +03:30

19 lines
303 B
TypeScript

import { create } from 'zustand';
interface AlarmStore {
isPlaying: boolean;
play: () => void;
stop: () => void;
}
export const useAlarmStore = create<AlarmStore>()(set => ({
isPlaying: false,
play() {
set({ isPlaying: true });
},
stop() {
set({ isPlaying: false });
},
}));