Function addActionMiddleware

  • Adds a global action middleware to be run when an action is performed. It is usually preferable to use onActionMiddleware instead to limit it to a given tree and only to topmost level actions or actionTrackingMiddleware for a simplified middleware.

    Parameters

    Returns ActionMiddlewareDisposer

    A disposer to cancel the middleware. Note that if you don't plan to do an early disposal of the middleware calling this function becomes optional.