Interface for the parameters of the IPreventLeaveParams class.

interface IPreventLeaveParams<Data = IAnything, ID = string> {
    changeSubject?: TSubject<Data>;
    checkDirty?: (prevData: Data, currentData: Data) => boolean;
    checkUpdate?: (id: ID, data: Data) => boolean;
    data?: null | Data;
    fallback?: (e: Error) => void;
    history?: any;
    onBlock?: () => void | () => void;
    onChange?: (Data: Data, initial: boolean) => void;
    onLoadEnd?: (isOk: boolean) => void;
    onLoadStart?: () => void;
    onSave?: (data: Data) => boolean | Promise<boolean>;
    onUpdate?: (id: ID, data: Data) => void;
    readonly?: boolean;
    shouldAutoSave?: () => boolean;
    updateSubject?: TSubject<[ID, Data]>;
    waitForChangesDelay?: number;
}

Type Parameters

  • Data = IAnything

    The type of data.

  • ID = string

    The type of ID.

Properties

changeSubject?: TSubject<Data>
checkDirty?: (prevData: Data, currentData: Data) => boolean
checkUpdate?: (id: ID, data: Data) => boolean
data?: null | Data
fallback?: (e: Error) => void
history?: any
onBlock?: () => void | () => void
onChange?: (Data: Data, initial: boolean) => void
onLoadEnd?: (isOk: boolean) => void
onLoadStart?: () => void
onSave?: (data: Data) => boolean | Promise<boolean>
onUpdate?: (id: ID, data: Data) => void
readonly?: boolean
shouldAutoSave?: () => boolean
updateSubject?: TSubject<[ID, Data]>
waitForChangesDelay?: number