Created
December 30, 2017 15:50
-
-
Save dmmarmol/f21ab9338fb7fd5dea8a3f087c2264e3 to your computer and use it in GitHub Desktop.
An example of a typed react-redux middleware using Typescript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Action } from 'redux/store-types'; | |
import { Dispatch, MiddlewareAPI, Store } from 'redux'; | |
export const authMiddleware = (_api: MiddlewareAPI<Store<void>>) => ( | |
next: Dispatch<void> | |
) => <A extends Action>(action: A) => { | |
return next(action); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment