@@ -3,16 +3,17 @@ import 'babel-polyfill';
3
3
import React from 'react' ;
4
4
import ReactDOM from 'react-dom' ;
5
5
import { Provider } from 'react-redux' ;
6
- import { applyMiddleware , compose , createStore } from 'redux' ;
6
+ import { AnyAction , applyMiddleware , compose , createStore } from 'redux' ;
7
7
import persistState from 'redux-localstorage' ;
8
- import thunk from 'redux-thunk' ;
8
+ import thunk , { ThunkDispatch } from 'redux-thunk' ;
9
9
import * as url from 'url' ;
10
10
11
- import { gotoPosition , performCratesLoad , performVersionsLoad } from './actions' ;
11
+ import { Action , gotoPosition , performCratesLoad , performVersionsLoad } from './actions' ;
12
12
import { configureRustErrors } from './highlighting' ;
13
13
import { deserialize , serialize } from './local_storage' ;
14
14
import PageSwitcher from './PageSwitcher' ;
15
15
import playgroundApp from './reducers' ;
16
+ import { State } from './reducers' ;
16
17
import Router from './Router' ;
17
18
18
19
const baseUrl = url . resolve ( window . location . href , '/' ) ;
@@ -23,9 +24,8 @@ const initialState = {
23
24
} ,
24
25
} ;
25
26
26
- const mw = [ thunk ] ;
27
- const middlewares = applyMiddleware ( ...mw ) ;
28
- const composeEnhancers = window . __REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose ;
27
+ const middlewares = applyMiddleware < ThunkDispatch < State , { } , Action > , { } > ( thunk ) ;
28
+ const composeEnhancers : typeof compose = window . __REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose ;
29
29
const enhancers = composeEnhancers ( middlewares , persistState ( undefined , { serialize, deserialize } ) ) ;
30
30
const store = createStore ( playgroundApp , initialState , enhancers ) ;
31
31
0 commit comments