File tree 1 file changed +31
-0
lines changed
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { create } from 'zustand' ;
2
+ import { persist } from 'zustand/middleware' ;
3
+
4
+ interface ChannelActionState {
5
+ isInVoiceChannel : boolean ;
6
+ isSharingScreen : boolean ;
7
+ isVideoOn : boolean ;
8
+ isMicOn : boolean ;
9
+ setIsInVoiceChannel : ( ) => void ;
10
+ setIsSharingScreen : ( ) => void ;
11
+ setIsVideoOn : ( ) => void ;
12
+ setIsMicOn : ( ) => void ;
13
+ }
14
+
15
+ export const useChannelActionStore = create < ChannelActionState > ( ) (
16
+ persist (
17
+ ( set ) => ( {
18
+ isInVoiceChannel : false ,
19
+ isSharingScreen : false ,
20
+ isVideoOn : false ,
21
+ isMicOn : false ,
22
+ setIsInVoiceChannel : ( ) => set ( ( state ) => ( { isInVoiceChannel : ! state . isInVoiceChannel } ) ) ,
23
+ setIsSharingScreen : ( ) => set ( ( state ) => ( { isSharingScreen : ! state . isSharingScreen } ) ) ,
24
+ setIsVideoOn : ( ) => set ( ( state ) => ( { isVideoOn : ! state . isVideoOn } ) ) ,
25
+ setIsMicOn : ( ) => set ( ( state ) => ( { isMicOn : ! state . isMicOn } ) ) ,
26
+ } ) ,
27
+ {
28
+ name : 'channelAction' ,
29
+ } ,
30
+ ) ,
31
+ ) ;
You can’t perform that action at this time.
0 commit comments