refactor: rename playback suspender
This commit is contained in:
@@ -5,13 +5,13 @@ import { create } from "zustand";
|
||||
* `suspend()` on mount and `release()` on unmount. Stream playback is suspended
|
||||
* whenever `suspendCount > 0`.
|
||||
*/
|
||||
interface PlaybackState {
|
||||
interface PlaybackSuspenderState {
|
||||
suspendCount: number;
|
||||
suspend: () => void;
|
||||
release: () => void;
|
||||
}
|
||||
|
||||
export const usePlaybackStore = create<PlaybackState>((set) => ({
|
||||
export const usePlaybackSuspenderStore = create<PlaybackSuspenderState>((set) => ({
|
||||
suspendCount: 0,
|
||||
suspend: () => set((s) => ({ suspendCount: s.suspendCount + 1 })),
|
||||
release: () => set((s) => ({ suspendCount: Math.max(0, s.suspendCount - 1) })),
|
||||
Reference in New Issue
Block a user