Skip to content

Commit cd476b1

Browse files
committed
fix: Location type for History 5.x
1 parent 328cf16 commit cd476b1

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "redux-first-history",
3-
"version": "5.0.10",
3+
"version": "5.0.11",
44
"description": "Redux First History - Redux history binding support react-router - @reach/router - wouter",
55
"main": "build/es5/index.js",
66
"module": "build/es6/index.js",

src/actions.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Location, Action, History } from 'history';
2-
import { AnyAction as ReduxAction } from 'redux';
1+
import type { Location, Action, History } from 'history';
2+
import type { AnyAction as ReduxAction } from 'redux';
33

44
export const CALL_HISTORY_METHOD = '@@router/CALL_HISTORY_METHOD';
55
export const LOCATION_CHANGE = '@@router/LOCATION_CHANGE';
@@ -16,7 +16,7 @@ export type HistoryMethods =
1616

1717
export const locationChangeAction = (location: Location, action: Action) => ({
1818
type: LOCATION_CHANGE,
19-
payload: { location, action },
19+
payload: { location, action } as { location: Location; action: Action },
2020
});
2121

2222
function updateLocation<T extends HistoryMethods>(method: T) {
@@ -36,12 +36,12 @@ export const goForward: () => ReduxAction = updateLocation('goForward');
3636
export const back: () => ReduxAction = updateLocation('back');
3737
export const forward: () => ReduxAction = updateLocation('forward');
3838

39-
export type RouterActions =
40-
ReturnType<typeof push> |
41-
ReturnType<typeof replace> |
42-
ReturnType<typeof go> |
43-
ReturnType<typeof goBack> |
44-
ReturnType<typeof goForward> |
45-
ReturnType<typeof locationChangeAction> |
46-
ReturnType<typeof back> |
47-
ReturnType<typeof forward>;
39+
export type RouterActions =
40+
| ReturnType<typeof push>
41+
| ReturnType<typeof replace>
42+
| ReturnType<typeof go>
43+
| ReturnType<typeof goBack>
44+
| ReturnType<typeof goForward>
45+
| ReturnType<typeof locationChangeAction>
46+
| ReturnType<typeof back>
47+
| ReturnType<typeof forward>;

0 commit comments

Comments
 (0)