translucentDispatchOf
inline fun <T : Action> MiddlewareScope<*>.translucentDispatchOf(crossinline block: (T) -> Unit): DispatchFunction
Creates a dispatch function that executes a given block for every action with given supertype T and passes every action to the next middleware.
Example of usage:
inline fun <reified T : Action> filteredDebugMiddleware(): Middleware<AppState> = {
translucentDispatchOf<T> { action ->
println(action)
}
}
Content copied to clipboard