Function createQueueingService

  • Creates a Service - a concurrency-controlled wrapper around an effect, which tracks state over the effect's lifecycle events. The effect can be a Promise-or-Observable returning function, and is cancelable if Observable. Its concurrency mode is to queue up handlers.

    Type Parameters

    • TRequest
    • TNext = void
    • TError = Error
    • TState = null | TNext

    Parameters

    • actionNamespace: string

      Prefix of all actions eg fetch/request

    • handler: EventHandler<TRequest, TNext>

      Function returning Promise, Observable or generator from which events are generated

    • Optional reducerProducer: ReducerProducer<TRequest, TNext, TError, TState>

      Function returning a reducer for #state - recieves ProcessLifecycleActions as its argument. Defaults to producing state which is always the most recently returned response from the handler.

    Returns Service<TRequest, TNext, TError, TState>

    A service in queueing mode.

    Summary

    queueing mode