Skip to content

Commit

Permalink
fix: lint issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
xobotyi committed Mar 11, 2021
1 parent 110f072 commit 3e8af15
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
5 changes: 1 addition & 4 deletions src/useMeasure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ export type UseMeasureRect = Pick<
'x' | 'y' | 'top' | 'left' | 'right' | 'bottom' | 'height' | 'width'
>;
export type UseMeasureRef<E extends Element = Element> = (element: E) => void;
export type UseMeasureResult<E extends Element = Element> = [
UseMeasureRef<E>,
UseMeasureRect
];
export type UseMeasureResult<E extends Element = Element> = [UseMeasureRef<E>, UseMeasureRect];

const defaultState: UseMeasureRect = {
x: 0,
Expand Down
8 changes: 4 additions & 4 deletions tests/useUnmountPromise.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ describe('useUnmountPromise', () => {
]);
expect(res).toBe('UNMOUNTED');
});

it('should resolve promise when component is updated', async () => {
const hook = renderHook(() => useUnmountPromise());

const mounted = hook.result.current;
const pRes = mounted(new Promise(r => setTimeout(() => r(25), 10)));
const pRes = mounted(new Promise((r) => setTimeout(() => r(25), 10)));

hook.rerender();

const res = await pRes;

expect(res).toBe(25);
Expand Down
3 changes: 2 additions & 1 deletion tests/useWindowScroll.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ describe('useWindowScroll', () => {
const initialScroll = { x: 1, y: 2 };
const afterRenderScroll = { x: 2, y: 3 };
const result = {
x: 0, y: 0
x: 0,
y: 0,
};

setWindowScroll(initialScroll.x, initialScroll.y);
Expand Down

0 comments on commit 3e8af15

Please sign in to comment.