Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface RetryOptions<V>

Options object for Bacon.retry.

Type parameters

  • V

Hierarchy

  • RetryOptions

Index

Properties

Methods

Properties

Optional retries

retries: undefined | number

Required. The number of times to retry the source function in addition to the initial attempt. The default value is 0 (zero) for retrying indefinitely.

source

source: function

Required. A function that produces an Observable. The function gets attempt number (starting from zero) as its argument.

Type declaration

Methods

Optional delay

  • Optional. A function that returns the time in milliseconds to wait before retrying. Defaults to 0. The function is given a context object with the keys error (the error that occurred) and retriesDone (the number of retries already performed) to help determine the appropriate delay e.g. for an incremental backoff.

    Parameters

    Returns number

Optional isRetryable

  • isRetryable(error: any): boolean
  • Optional. A function returning true to continue retrying, false to stop. Defaults to true. The error that occurred is given as a parameter. For example, there is usually no reason to retry a 404 HTTP error, whereas a 500 or a timeout might work on the next attempt.

    Parameters

    • error: any

    Returns boolean

Generated using TypeDoc