260224:1606 20260224:1600 V1.8.0
All checks were successful
Build and Deploy / deploy (push) Successful in 6m25s
All checks were successful
Build and Deploy / deploy (push) Successful in 6m25s
This commit is contained in:
@@ -2,10 +2,13 @@
|
||||
import { create } from 'zustand';
|
||||
import { persist, createJSONStorage } from 'zustand/middleware';
|
||||
|
||||
/** A draft can hold any serializable form data — typed as unknown for strictness */
|
||||
type DraftValue = Record<string, unknown>;
|
||||
|
||||
interface DraftState {
|
||||
drafts: Record<string, any>;
|
||||
saveDraft: (key: string, data: any) => void;
|
||||
getDraft: (key: string) => any;
|
||||
drafts: Record<string, DraftValue>;
|
||||
saveDraft: (key: string, data: DraftValue) => void;
|
||||
getDraft: (key: string) => DraftValue | undefined;
|
||||
clearDraft: (key: string) => void;
|
||||
}
|
||||
|
||||
@@ -26,4 +29,4 @@ export const useDraftStore = create<DraftState>()(
|
||||
storage: createJSONStorage(() => localStorage),
|
||||
}
|
||||
)
|
||||
);
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user