mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-13 05:20:25 +00:00
update support 4.0.0
This commit is contained in:
@@ -6,15 +6,10 @@
|
||||
|
||||
import { createStore, combineReducers, applyMiddleware } from 'redux';
|
||||
import { browserHistory } from 'react-router';
|
||||
import { syncHistory, routeReducer } from 'react-router-redux';
|
||||
import { syncHistoryWithStore, routerReducer } from 'react-router-redux';
|
||||
|
||||
const reducer = combineReducers({ routing: routeReducer });
|
||||
const reducer = combineReducers({ routing: routerReducer });
|
||||
const store = createStore(reducer);
|
||||
|
||||
// Sync dispatched route actions to the history
|
||||
const reduxRouterMiddleware = syncHistory(browserHistory);
|
||||
const createStoreWithMiddleware = applyMiddleware(reduxRouterMiddleware)(createStore);
|
||||
|
||||
const store = createStoreWithMiddleware(reducer);
|
||||
|
||||
// Required for replaying actions from devtools to
|
||||
reduxRouterMiddleware.listenForReplays(store);
|
||||
// Create an enhanced history that syncs navigation events with the store
|
||||
const history = syncHistoryWithStore(browserHistory, store)
|
||||
|
||||
+8
-8
@@ -1,4 +1,4 @@
|
||||
// Type definitions for react-router-redux v2.1.0
|
||||
// Type definitions for react-router-redux v4.0.0
|
||||
// Project: https://github.com/rackt/react-router-redux
|
||||
// Definitions by: Isman Usoh <http://github.com/isman-usoh>, Noah Shipley <https://github.com/noah79>, Dimitri Rosenberg <https://github.com/rosendi>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
@@ -10,15 +10,15 @@ declare namespace ReactRouterRedux {
|
||||
import R = Redux;
|
||||
import H = HistoryModule;
|
||||
|
||||
const TRANSITION: string;
|
||||
const UPDATE_LOCATION: string;
|
||||
const CALL_HISTORY_METHOD: string;
|
||||
const LOCATION_CHANGE: string;
|
||||
|
||||
const push: PushAction;
|
||||
const replace: ReplaceAction;
|
||||
const go: GoAction;
|
||||
const goBack: GoForwardAction;
|
||||
const goForward: GoBackAction;
|
||||
const routeActions: RouteActions;
|
||||
const routerActions: RouteActions;
|
||||
|
||||
type LocationDescriptor = H.Location | H.Path;
|
||||
type PushAction = (nextLocation: LocationDescriptor) => void;
|
||||
@@ -34,13 +34,13 @@ declare namespace ReactRouterRedux {
|
||||
goForward: GoForwardAction;
|
||||
goBack: GoBackAction;
|
||||
}
|
||||
interface HistoryMiddleware extends R.Middleware {
|
||||
listenForReplays(store: R.Store, selectLocationState?: Function): void;
|
||||
interface HistoryMiddleware extends H.History {
|
||||
unsubscribe(): void;
|
||||
}
|
||||
|
||||
function routeReducer(state?: any, options?: any): R.Reducer;
|
||||
function syncHistory(history: H.History): HistoryMiddleware;
|
||||
function routerReducer(state?: any, options?: any): R.Reducer;
|
||||
function syncHistoryWithStore(history: H.History, store: R.Store, options?: any): HistoryMiddleware;
|
||||
function routerMiddleware(history: H.History): Function;
|
||||
}
|
||||
|
||||
declare module "react-router-redux" {
|
||||
|
||||
Reference in New Issue
Block a user