MCPcopy
hub / github.com/reduxjs/redux / thunk

Function thunk

test/typescript/middleware.ts:69–80  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

67}
68
69function thunk<S, DispatchExt>() {
70 const thunkMiddleware: Middleware<
71 ThunkDispatch<S, DispatchExt>,
72 S,
73 Dispatch & ThunkDispatch<S>
74 > = api => next => action =>
75 typeof action === 'function'
76 ? action(api.dispatch, api.getState)
77 : next(action)
78
79 return thunkMiddleware
80}
81
82/**
83 * Middleware that expects exact state type.

Callers 1

applyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected