@resistdesign/voltra
    Preparing search index...

    Type Alias ApplicationStateLoader<ValueType, ArgsType>

    ApplicationStateLoader: ApplicationStateValueController<ValueType> & {
        cancelPendingRequest: () => void;
        invalidate: () => void;
        latestError: any;
        loading: boolean;
        makeRemoteProcedureCall: (
            ...args: ArgsType,
        ) => Promise<ApplicationStateLoaderRequestResult<ValueType>>;
    }

    Access and track the loading of an application state value.

    Type Parameters

    Type Declaration

    • cancelPendingRequest: () => void

      Cancel and invalidate all currently pending requests owned by this loader without starting a replacement request.

    • invalidate: () => void

      Force a reload by invalidating the internal cache key.

    • latestError: any

      The most recent error, if any.

    • loading: boolean

      Whether the current request is in flight.

    • makeRemoteProcedureCall: (...args: ArgsType) => Promise<ApplicationStateLoaderRequestResult<ValueType>>

      Trigger a remote procedure call with the provided args.

      The identified application-state value is still updated on success. The returned result lets imperative flows coordinate success, failure, and cancellation without bypassing the loader or duplicating request state.