mirror of
https://github.com/bendtherules/some-hooks.git
synced 2026-08-18 13:52:05 +00:00
prettier - Format existing files with prettier
This commit is contained in:
+5
-7
@@ -1,9 +1,7 @@
|
||||
import * as React from 'react';
|
||||
import * as React from "react";
|
||||
|
||||
export const useMyHook = () => {
|
||||
let [{
|
||||
counter
|
||||
}, setState] = React.useState<{
|
||||
let [{ counter }, setState] = React.useState<{
|
||||
counter: number;
|
||||
}>({
|
||||
counter: 0
|
||||
@@ -12,12 +10,12 @@ export const useMyHook = () => {
|
||||
React.useEffect(() => {
|
||||
let interval = window.setInterval(() => {
|
||||
counter++;
|
||||
setState({counter})
|
||||
}, 1000)
|
||||
setState({ counter });
|
||||
}, 1000);
|
||||
return () => {
|
||||
window.clearInterval(interval);
|
||||
};
|
||||
}, []);
|
||||
|
||||
return counter;
|
||||
};
|
||||
};
|
||||
|
||||
+6
-6
@@ -1,7 +1,7 @@
|
||||
import { useMyHook } from './'
|
||||
import { useMyHook } from "./";
|
||||
|
||||
describe('useMyHook', () => {
|
||||
it('is truthy', () => {
|
||||
expect(useMyHook).toBeTruthy()
|
||||
})
|
||||
})
|
||||
describe("useMyHook", () => {
|
||||
it("is truthy", () => {
|
||||
expect(useMyHook).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user