Skip to content

Commit

Permalink
Merge pull request #53 from thesbros/types-2
Browse files Browse the repository at this point in the history
Add RouterState to typings
  • Loading branch information
supasate authored May 2, 2017
2 parents e2836ee + 9d698b3 commit 0998e51
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
9 changes: 2 additions & 7 deletions examples/typescript/src/reducers/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { combineReducers } from 'redux'
import { RouterState } from 'connected-react-router'
import counterReducer from './counter'

const rootReducer = combineReducers({
Expand All @@ -7,13 +8,7 @@ const rootReducer = combineReducers({

export interface State {
count: number
router: {
location: {
pathname: string
search: string
hash: string
}
}
router: RouterState
}

export default rootReducer
10 changes: 10 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ declare module 'connected-react-router' {
history: History
}

export interface RouterState {
location: {
pathname: string,
search: string,
hash: string,
key: string,
},
action: 'POP' | 'PUSH'
}

export const LOCATION_CHANGE: string
export const CALL_HISTORY_METHOD: string

Expand Down

0 comments on commit 0998e51

Please sign in to comment.