Skip to content

Commit

Permalink
migrate test helpers to typescript (reduxjs#3515)
Browse files Browse the repository at this point in the history
Former-commit-id: 82d5a48
Former-commit-id: a06f235
  • Loading branch information
cellog authored and timdorr committed Aug 18, 2019
1 parent d4083c1 commit 2e211b7
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 6 deletions.
1 change: 0 additions & 1 deletion test/helpers/actionCreators.js.REMOVED.git-id

This file was deleted.

1 change: 1 addition & 0 deletions test/helpers/actionCreators.ts.REMOVED.git-id
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
46964ea9cef1aec64487cde982fc7450877410d7
File renamed without changes.
4 changes: 0 additions & 4 deletions test/helpers/middleware.js

This file was deleted.

12 changes: 12 additions & 0 deletions test/helpers/middleware.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { MiddlewareAPI, Dispatch, AnyAction } from '../..'

type ThunkAction<T extends any = any> = T extends AnyAction
? AnyAction
: T extends Function
? T
: never

export function thunk({ dispatch, getState }: MiddlewareAPI) {
return (next: Dispatch) => <T>(action: ThunkAction) =>
typeof action === 'function' ? action(dispatch, getState) : next(action)
}
1 change: 0 additions & 1 deletion test/helpers/reducers.js.REMOVED.git-id

This file was deleted.

1 change: 1 addition & 0 deletions test/helpers/reducers.ts.REMOVED.git-id
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
c10d3d017ed4b5122d25d5ed2b80309ccadf7cf9

0 comments on commit 2e211b7

Please sign in to comment.