import type { Middleware } from 'redux' ; export interface GetEffects { ( namespace , methodName ) : any ; } export function createAsyncMiddleware ( getEffects ) { return ( store ) => ( next ) => ( action ) => { const [ namespace , methodName ] = action . type . split ( '/' ) ; const effect = getEffects ( namespace , methodName ) ; effect ?. ( action , store ) ; return next ( action ) ; } ; }