Skip to content

Commit

Permalink
Allow unique selector fn to return undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnixon committed Jan 28, 2023
1 parent 6740b3c commit 892bd8d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/page-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export type PageState = ScrollPosition & {
* Get the current page state.
*/
export const getPageState = (
unique: (element: Element) => Selector,
unique: (element: Element) => Selector | undefined,
): PageState => {
const focusSelector =
document.activeElement !== null
Expand Down
2 changes: 1 addition & 1 deletion src/router-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export type RouterSettings<Location> = {
readonly focusAndScrollIntoViewIfRequired: typeof focusAndScrollIntoViewIfRequired;
readonly resetFocus: typeof resetFocus;
readonly setTitle: typeof setTitle;
readonly unique: (element: Element) => Selector;
readonly unique: (element: Element) => Selector | undefined;
};

export const defaultSettings: RouterSettings<unknown> = {
Expand Down

0 comments on commit 892bd8d

Please sign in to comment.