Interface IPromiseOptions<Pending, Success, Error>

Parameters for notification depending on a promise.

interface IPromiseOptions<Pending, Success, Error> {
    error: {
        message: ((reason, data?) => string);
        options?: Notification.IOptions<Error>;
    };
    pending: {
        message: string;
        options?: Notification.IOptions<Pending>;
    };
    success: {
        message: ((result, data?) => string);
        options?: Notification.IOptions<Success>;
    };
}

Type Parameters

  • Pending extends ReadonlyJSONValue
  • Success extends ReadonlyJSONValue = Pending
  • Error extends ReadonlyJSONValue = Pending

Properties

Properties

error: {
    message: ((reason, data?) => string);
    options?: Notification.IOptions<Error>;
}

Message when promise rejects and options

The message factory receives as first argument the error of the promise and as second the error options.data.

Notes

The message will be truncated if longer than 140 characters.

Type declaration

  • message: ((reason, data?) => string)
      • (reason, data?): string
      • Parameters

        • reason: unknown
        • Optional data: Error

        Returns string

  • Optional options?: Notification.IOptions<Error>
pending: {
    message: string;
    options?: Notification.IOptions<Pending>;
}

Promise pending message and options

Notes

The message will be truncated if longer than 140 characters.

Type declaration

success: {
    message: ((result, data?) => string);
    options?: Notification.IOptions<Success>;
}

Message when promise resolves and options

The message factory receives as first argument the result of the promise and as second the success options.data.

Notes

The message will be truncated if longer than 140 characters.

Type declaration