Skip to content

Commit 03a8b81

Browse files
committed
fix: make generic type THistory optional
1 parent 61f852c commit 03a8b81

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/router/router.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
RouterType,
1717
} from './router.types.js';
1818

19-
export class Router<THistory extends AnyHistory> implements IRouter<THistory> {
19+
export class Router<THistory extends AnyHistory = AnyHistory> implements IRouter<THistory> {
2020
history: THistory;
2121
location: THistory['location'];
2222
queryParams: IQueryParams;

src/router/router.types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { AnyHistory, IQueryParams } from 'mobx-location-history';
22

3-
export interface IRouter<THistory extends AnyHistory> {
3+
export interface IRouter<THistory extends AnyHistory = AnyHistory> {
44
history: THistory;
55
location: THistory['location'];
66
queryParams: IQueryParams;
@@ -64,7 +64,7 @@ export type RouterToConfig =
6464

6565
export type RouterType = 'browser' | 'hash';
6666

67-
export interface RouterConfig<THistory extends AnyHistory> {
67+
export interface RouterConfig<THistory extends AnyHistory = AnyHistory> {
6868
history?: THistory;
6969
location?: THistory['location'];
7070
queryParams?: IQueryParams;

0 commit comments

Comments
 (0)