Skip to content

Commit 998d777

Browse files
committed
change
1 parent d814dfc commit 998d777

File tree

5 files changed

+11
-13
lines changed

5 files changed

+11
-13
lines changed

flow-typed/self-define/injectAbleStore.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// @flow
12
declare module '$self-define' {
23
declare type StoreWithInjectAble = {
34
inject: (namespace: any, reducer: any) => void,
@@ -10,7 +11,7 @@ declare module '$self-define' {
1011
subscribe(listener: () => void): () => void,
1112
replaceReducer(nextReducer: (state: any, action: any) => any): void
1213
};
13-
declare type routeProps = {
14+
declare type RouteProps = {
1415
path: string,
1516
component: (props?: Object) => React$Element<any>,
1617
routes?: Array<Object>,

src/components/RouteWithSubRoutes/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
// @flow
22
import React from 'react';
33
import { Route } from 'react-router-dom';
4+
import type { RouteProps } from '$self-define';
45

5-
export default (routeProps: routeProps) => {
6+
export default (routeProps: RouteProps) => {
67
return (
78
<Route
89
path={routeProps.path}

src/routes/increase/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type StoreWithInjectAble from '$self-define';
1+
import type { StoreWithInjectAble } from '$self-define';
22

33
export default (store: StoreWithInjectAble) => () => {
44
import('./reducers').then(reducers => {

src/routes/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import RouteWithSubRoutes from '$components/RouteWithSubRoutes';
55
import bundleLoader from '$utils/bundle';
66
import Home from './home';
77
import Increase from './increase';
8-
import type { StoreWithInjectAble } from '$self-define';
8+
import type { StoreWithInjectAble, RouteProps } from '$self-define';
99

10-
function routes(store): Array<routeProps> {
10+
function routes(store): Array<RouteProps> {
1111
return [
1212
{
1313
path: '/',

src/store/createStore.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { applyMiddleware, compose } from 'redux';
22
import thunk from 'redux-thunk';
3-
import location, { updateLocation } from '$reducers/location';
3+
import location from '$reducers/location';
44
import createStore from './createInjectAbleStore';
55

66
export default (initialState = {}) => {
@@ -19,13 +19,9 @@ export default (initialState = {}) => {
1919
middleware.push(logger);
2020
}
2121

22-
const store = createStore(
23-
initialState,
24-
compose(
25-
applyMiddleware(...middleware),
26-
...enhancers
27-
), { location }
28-
);
22+
const store = createStore(initialState, compose(applyMiddleware(...middleware), ...enhancers), {
23+
location,
24+
});
2925
// inject global reducers
3026
store.injectAll(globalReducerMaps);
3127

0 commit comments

Comments
 (0)