24 lines
542 B
TypeScript
24 lines
542 B
TypeScript
import { create } from "zustand"
|
|
|
|
interface EditProfileState {
|
|
pending: boolean
|
|
valid: boolean
|
|
}
|
|
|
|
interface EditProfileActions {
|
|
setIsPending: (isPending: boolean) => void
|
|
setValid: (isValid: boolean) => void
|
|
}
|
|
|
|
export interface EditProfileStore
|
|
extends EditProfileActions,
|
|
EditProfileState { }
|
|
|
|
export const useProfileStore = create<EditProfileStore>()((set) => ({
|
|
pending: false,
|
|
valid: true,
|
|
|
|
setIsPending: (isPending) => set(() => ({ pending: isPending })),
|
|
setValid: (isValid) => set(() => ({ valid: isValid })),
|
|
}))
|