Skip to content

Commit

Permalink
Upgrade TypeScript to ~2.4.0, Fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Wang Zhongliang committed Feb 27, 2018
1 parent 086802a commit 9d5899c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@
"mocha": "^2.2.5",
"redux": "4.0.0-beta.2",
"rimraf": "^2.5.2",
"typescript": "^1.8.10",
"typescript-definition-tester": "0.0.4",
"typescript": "~2.4.0",
"typescript-definition-tester": "0.0.5",
"webpack": "^1.12.14"
}
}
20 changes: 14 additions & 6 deletions test/typescript.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
import {Store, Middleware} from 'redux';
import thunk, {ThunkAction} from '../index.d.ts';
import thunk, {ThunkAction} from '../index';

type State = {
foo: string
};

type Actions = { type: 'FOO' };

declare const store: Store<{foo: string}>;
declare const store: Store<State, Actions>;

store.dispatch(dispatch => {
dispatch({type: 'FOO'});
});

store.dispatch((dispatch, getState) => {
const state = getState();
function testGetState(): ThunkAction<void, State, {}, Actions> {
return (dispatch, getState) => {
const state = getState();
const foo: string = state.foo;
};
}

const foo: string = state.foo;
});
store.dispatch(testGetState());

const middleware: Middleware = thunk.withExtraArgument('bar');

Expand Down

0 comments on commit 9d5899c

Please sign in to comment.