mirror of
https://github.com/priyanshujain/margin.git
synced 2026-10-02 19:17:03 +00:00
changes
This commit is contained in:
1 parent
78fff9b6f4
commit
7cc36e3e40
37 files changed
+55361
-103
No files matched your search
@@ -0,0 +1,26 @@
|
||||
import { create } from "zustand";
|
||||
|
||||
interface ProofingState {
|
||||
spelling: boolean;
|
||||
grammar: boolean;
|
||||
ignored: Set<string>;
|
||||
toggleSpelling: () => void;
|
||||
toggleGrammar: () => void;
|
||||
ignore: (signature: string) => void;
|
||||
resetIgnored: () => void;
|
||||
}
|
||||
|
||||
export const useProofing = create<ProofingState>((set) => ({
|
||||
spelling: true,
|
||||
grammar: false,
|
||||
ignored: new Set(),
|
||||
toggleSpelling: () => set((s) => ({ spelling: !s.spelling })),
|
||||
toggleGrammar: () => set((s) => ({ grammar: !s.grammar })),
|
||||
ignore: (signature) =>
|
||||
set((s) => {
|
||||
const ignored = new Set(s.ignored);
|
||||
ignored.add(signature);
|
||||
return { ignored };
|
||||
}),
|
||||
resetIgnored: () => set({ ignored: new Set() }),
|
||||
}));
|
||||
Reference in new issue
Block a user