• Creates a retriable optical by exponential backoff method. It increases the delay duration (100 milliseconds) multiplied by the power of two, but its exponent stops at 23.

    Parameters

    • maxRetries: number

      Maximum retry counts.

    • waiter: ((milliseconds) => Promise<void>) = ...

      The waiter function to delay. Defaults to setTimeout method.

        • (milliseconds): Promise<void>
        • Parameters

          • milliseconds: number

          Returns Promise<void>

    Returns (<E, T>(fallback) => (<S, A>(triable) => (<B>(set) => Optical<PromiseHkt, S, T, A, B>)))

    The retriable optical.

      • <E, T>(fallback): (<S, A>(triable) => (<B>(set) => Optical<PromiseHkt, S, T, A, B>))
      • Type Parameters

        • E

        • T

        Parameters

        • fallback: ((err) => T)
            • (err): T
            • Parameters

              • err: E

              Returns T

        Returns (<S, A>(triable) => (<B>(set) => Optical<PromiseHkt, S, T, A, B>))

          • <S, A>(triable): (<B>(set) => Optical<PromiseHkt, S, T, A, B>)
          • Type Parameters

            • S

            • A

            Parameters

            • triable: ((data) => ((state) => Promise<Result<E, A>>))
                • (data): ((state) => Promise<Result<E, A>>)
                • Parameters

                  • data: S

                  Returns ((state) => Promise<Result<E, A>>)

                    • (state): Promise<Result<E, A>>
                    • Parameters

                      • state: number

                      Returns Promise<Result<E, A>>

            Returns (<B>(set) => Optical<PromiseHkt, S, T, A, B>)

              • <B>(set): Optical<PromiseHkt, S, T, A, B>
              • Type Parameters

                • B

                Parameters

                • set: ((data) => ((modified) => T))
                    • (data): ((modified) => T)
                    • Parameters

                      • data: S

                      Returns ((modified) => T)

                        • (modified): T
                        • Parameters

                          • modified: B

                          Returns T

                Returns Optical<PromiseHkt, S, T, A, B>

Generated using TypeDoc