@mikuroxina/mini-fn
    Preparing search index...

    Function newRetriable

    • Creates a retriable optical which consists three functions:

      • triable: An operation that may fail.
      • strategy: Failure control strategy, which decides the operation should retry or exit.
      • set: A function that stores B into S and produces T.
                            ok
      S -+--->[ triable ]-+-------> A
         |         ^      |
         |   retry |      | err
         |         |      V
         |       [ strategy ]
         |        |
         +--------|-------+
                  | exit  |
                  |       V
      T <---------+----[ set ]<- B
      

      Type Parameters

      • M

      Parameters

      Returns <I>(
          initialState: I,
      ) => <E, T>(
          strategy: (
              err: E,
          ) => (state: I) => Get1<M, ControlFlow.ControlFlow<T, I>>,
      ) => <S, A>(
          triable: (data: S) => (state: I) => Get1<M, Result.Result<E, A>>,
      ) => <B>(
          set: (data: S) => (modified: B) => T,
      ) => Optical.Optical<M, S, T, A, B>

      The retriable optical.