Skip to content

Commit

Permalink
add usePlaying store
Browse files Browse the repository at this point in the history
  • Loading branch information
MutazAshhab committed Aug 21, 2023
1 parent 59b04b0 commit 1fdffa3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/zustand/usePlaying.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { create } from 'zustand';

type Playing = {
playing: boolean;
play: () => void;
pause: () => void;
};

export const usePlaying = create<Playing>(set => ({
playing: false,
play: () => set({ playing: true }),
pause: () => set({ playing: false }),
}));

0 comments on commit 1fdffa3

Please sign in to comment.