@tb-dev/vue - v2.0.10
    Preparing search index...

    Interface AsyncRefOptions

    interface AsyncRefOptions {
        delay?: number;
        immediate?: boolean;
        onError?: (e: unknown) => void;
        onSuccess?: (data: any) => void;
        resetOnExecute?: boolean;
        throwError?: boolean;
    }

    Hierarchy

    • Options
      • AsyncRefOptions
    Index

    Properties

    delay?: number

    Delay for the first execution of the promise when "immediate" is true. In milliseconds.

    0
    
    immediate?: boolean

    Execute the promise right after the function is invoked. Will apply the delay if any.

    When set to false, you will need to execute it manually.

    true
    
    onError?: (e: unknown) => void

    Callback when error is caught.

    onSuccess?: (data: any) => void

    Callback when success is caught.

    resetOnExecute?: boolean

    Sets the state to initialState before executing the promise.

    This can be useful when calling the execute function more than once (for example, to refresh data). When set to false, the current state remains unchanged until the promise resolves.

    true
    
    throwError?: boolean

    An error is thrown when executing the execute function

    false