Skip to content

Commit 327f66e

Browse files
authored
Move useTimeout from common utils to controllers/hooks (#179)
1 parent b69c1bd commit 327f66e

File tree

6 files changed

+5
-4
lines changed

6 files changed

+5
-4
lines changed

src/__tests__/unit/common/utils/use-timeout/test.tsx renamed to src/__tests__/unit/controllers/hooks/use-timeout/test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { shallow } from 'enzyme';
21
import React from 'react';
3-
import { useTimeout } from '../../../../../common/utils';
2+
import { shallow } from 'enzyme';
3+
import { useTimeout } from '../../../../../controllers/hooks';
44

55
const setTimeoutSpy = jest.spyOn(global, 'setTimeout');
66
const clearTimeoutSpy = jest.spyOn(global, 'clearTimeout');

src/common/utils/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ export { generateLocationFromPath } from './generate-location';
88
export { createLegacyHistory } from './history';
99
export { isServerEnvironment } from './is-server-environment';
1010
export { findRouterContext, createRouterContext } from './router-context';
11-
export { useTimeout } from './use-timeout';

src/controllers/hooks/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ export {
55
useQueryParam,
66
usePathParam,
77
} from './router-store';
8+
export { useTimeout } from './use-timeout';

src/controllers/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export {
1111
useRouterActions,
1212
useQueryParam,
1313
usePathParam,
14+
useTimeout,
1415
} from './hooks';
1516
export {
1617
useResourceStoreContext,

src/ui/link/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ import {
1111
} from 'react';
1212

1313
import { LinkProps, Route } from '../../common/types';
14-
import { useTimeout } from '../../common/utils';
1514
import {
1615
createRouterContext,
1716
generateLocationFromPath,
1817
} from '../../common/utils';
1918
import { useRouterStoreStatic } from '../../controllers/router-store';
19+
import { useTimeout } from '../../controllers/hooks/use-timeout';
2020

2121
import { getValidLinkType, handleNavigation } from './utils';
2222

0 commit comments

Comments
 (0)