restructure files onto electron-vite boilerplate

This commit is contained in:
jeffvli
2025-05-18 14:03:18 -07:00
parent 91ce2cd8a1
commit 1cf587bc8f
457 changed files with 9927 additions and 11705 deletions
+14 -14
View File
@@ -2,6 +2,19 @@ import { create } from 'zustand';
import { devtools, subscribeWithSelector } from 'zustand/middleware';
import { immer } from 'zustand/middleware/immer';
export interface EventSlice extends EventState {
actions: {
favorite: (ids: string[], favorite: boolean) => void;
play: (id: string) => void;
rate: (ids: string[], rating: null | number) => void;
};
}
export interface EventState {
event: null | UserEvent;
ids: string[];
}
export type FavoriteEvent = {
event: 'favorite';
favorite: boolean;
@@ -14,24 +27,11 @@ export type PlayEvent = {
export type RatingEvent = {
event: 'rating';
rating: number | null;
rating: null | number;
};
export type UserEvent = FavoriteEvent | PlayEvent | RatingEvent;
export interface EventState {
event: UserEvent | null;
ids: string[];
}
export interface EventSlice extends EventState {
actions: {
favorite: (ids: string[], favorite: boolean) => void;
play: (id: string) => void;
rate: (ids: string[], rating: number | null) => void;
};
}
export const useEventStore = create<EventSlice>()(
subscribeWithSelector(
devtools(