format
parent
c98fdec10e
commit
151fc758c0
@ -1,11 +1,10 @@
|
|||||||
import { useEffect } from "react";
|
import { useEffect } from 'react';
|
||||||
|
|
||||||
export const useFocus = (action: (param: any) => void) => {
|
export const useFocus = (action: (param: any) => void) => {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
window.addEventListener("focus", action);
|
window.addEventListener('focus', action);
|
||||||
return () => {
|
return () => {
|
||||||
window.removeEventListener("focus", action);
|
window.removeEventListener('focus', action);
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
Loading…
Reference in New Issue