Skip to content

Commit

Permalink
Remove getPause setPause
Browse files Browse the repository at this point in the history
  • Loading branch information
willybrauner committed Oct 19, 2023
1 parent 65f5b00 commit c3ed7af
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions src/components/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ export interface IRouterContext extends IRouterContextStackStates {
routeIndex: number
previousPageIsMount: boolean
unmountPreviousPage: () => void
getPaused: () => boolean
setPaused: (value: boolean) => void
}

// -------------------------------------------------------------------------------- PREPARE / CONTEXT
Expand All @@ -85,8 +83,6 @@ export const RouterContext = createContext<IRouterContext>({
previousPageIsMount: true,
staticLocation: undefined,
unmountPreviousPage: () => {},
getPaused: () => false,
setPaused: (value: boolean) => {},
})
RouterContext.displayName = "RouterContext"

Expand Down Expand Up @@ -221,20 +217,6 @@ function Router(props: {
},
)

/**
* Enable paused on Router instance
*/
const _waitingUrl = useRef(null)
const _paused = useRef<boolean>(false)
const getPaused = () => _paused.current
const setPaused = (value: boolean) => {
_paused.current = value
if (!value && _waitingUrl.current) {
handleHistory(_waitingUrl.current)
_waitingUrl.current = null
}
}

const currentRouteRef = useRef<TRoute>()

/**
Expand All @@ -244,11 +226,6 @@ function Router(props: {
*/

const handleHistory = async (url = ""): Promise<void> => {
if (_paused.current) {
_waitingUrl.current = url
return
}

const matchingRoute = getRouteFromUrl({
pUrl: url,
pRoutes: routes,
Expand Down Expand Up @@ -408,8 +385,6 @@ function Router(props: {
routeIndex,
previousPageIsMount,
unmountPreviousPage,
getPaused,
setPaused,
}}
/>
)
Expand Down

0 comments on commit c3ed7af

Please sign in to comment.