Middleware

typealias Middleware<S, A> = (dispatch: Dispatch<A>, state: S) -> Dispatch<A>