mirror of
https://gh-proxy.org/https://github.com/tiajinsha/JKVideo
synced 2026-07-07 23:18:38 +08:00
1
This commit is contained in:
19
store/videoStore.ts
Normal file
19
store/videoStore.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { create } from 'zustand';
|
||||
|
||||
interface VideoStore {
|
||||
isActive: boolean;
|
||||
bvid: string;
|
||||
title: string;
|
||||
cover: string;
|
||||
setVideo: (bvid: string, title: string, cover: string) => void;
|
||||
clearVideo: () => void;
|
||||
}
|
||||
|
||||
export const useVideoStore = create<VideoStore>(set => ({
|
||||
isActive: false,
|
||||
bvid: '',
|
||||
title: '',
|
||||
cover: '',
|
||||
setVideo: (bvid, title, cover) => set({ isActive: true, bvid, title, cover }),
|
||||
clearVideo: () => set({ isActive: false }),
|
||||
}));
|
||||
Reference in New Issue
Block a user