mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-22 11:57:33 +08:00
* Update redux to 3.6.0 In contrast to https://github.com/reactjs/redux/blob/v3.6.0/index.d.ts: Because I didn't want to export Func0..3 I replaced them with their definition. * Fixed missing line * Correct errors * Update test to redux v3.6.0 See085eaec93d* Adapt redux test Corrected missing R.compose * include Func0..3 types as in Redux' index.d.ts * Update index.d.ts, include redux #1936f8ec3ef1c3* Update redux-tests.ts, include redux #1936f8ec3ef1c3* Update redux-devtools-tests.tsx
34 lines
765 B
TypeScript
34 lines
765 B
TypeScript
/// <reference types="react" />
|
|
/// <reference types="redux" />
|
|
|
|
import * as React from 'react'
|
|
import { compose, createStore, Reducer, Store } from 'redux'
|
|
import { Provider } from 'react-redux'
|
|
import { createDevTools, persistState } from 'redux-devtools'
|
|
|
|
declare var reducer: Reducer<any>
|
|
|
|
class DevToolsMonitor extends React.Component<any, any> {
|
|
}
|
|
|
|
const DevTools = createDevTools(
|
|
<DevToolsMonitor />
|
|
)
|
|
|
|
const finalCreateStore = compose<Redux.StoreEnhancerStoreCreator<{}>>(
|
|
DevTools.instrument(),
|
|
persistState('test-session')
|
|
)(createStore)
|
|
|
|
const store: Store<any> = finalCreateStore(reducer)
|
|
|
|
class App extends React.Component<any, any> {
|
|
render() {
|
|
return (
|
|
<Provider store={store}>
|
|
<DevTools />
|
|
</Provider>
|
|
)
|
|
}
|
|
}
|