數(shù)據(jù)技術 菜菜 數(shù)據(jù)分析+深度學習訓練營
將用戶傳入的 middleware[]
依次執(zhí)行,并將 middlewareAPI
作為參數(shù)傳給各個 Middleware
,Middleware
的例子如下
function logger({ getState }) {
?return next => action => {
? ?console.log('will dispatch', action)
? ?const returnValue = next(action)
? ?console.log('state after dispatch', getState())
? ?return returnValue ?}}
標簽: