function useInstaller() {
	const [standalone] = useState(isStandalone());
	const [installPrompt, setInstallPrompt] = useState(null);
	useEffect(() => awaitInstallPrompt((prompt, cancel) => {
		setInstallPrompt({ prompt: () =>
			prompt().then(installed => {
				installed && cancel();
				return installed;
			})
		});
	}));
	return ({ isStandalone: standalone, installPrompt: installPrompt && installPrompt.prompt });
}
/**
 * A Hook that implements the awaitInstallPrompt() lifecycle and returns
 * an object that contains the isStandalone and installPrompt props:
 *
 * @returns {Object}
 * * isStandalone - true if the app is running in standalone mode.
 * * installPrompt - the prompt function that you call at any time.
 */
A Hook that implements the awaitInstallPrompt() lifecycle and returns
an object that contains the isStandalone and installPrompt props.

@returns {Object}
isStandalone - true if the app is running in standalone mode.
installPrompt - the prompt function that you call at any time.
A Hook that implements the awaitInstallPrompt () lifecycle and returns an object that contains the isStandalone and installPrompt props . @returns { Object } isStandalone - true if the app is running in standalone mode . installPrompt - the prompt function that you call at any time .
function useInstaller() {
	const [standalone] = useState(isStandalone());
	const [installPrompt, setInstallPrompt] = useState(null);
	useEffect(() => awaitInstallPrompt((prompt, cancel) => {
		setInstallPrompt({ prompt: () =>
			prompt().then(installed => {
				installed && cancel();
				return installed;
			})
		});
	}));
	return ({ isStandalone: standalone, installPrompt: installPrompt && installPrompt.prompt });
}
function useInstaller ( ) { const [ standalone ] = useState ( isStandalone ( ) ) ; const [ installPrompt , setInstallPrompt ] = useState ( null ) ; useEffect ( ( ) => awaitInstallPrompt ( ( prompt , cancel ) => { setInstallPrompt ( { prompt : ( ) => prompt ( ) . then ( installed => { installed && cancel ( ) ; return installed ; } ) } ) ; } ) ) ; return ( { isStandalone : standalone , installPrompt : installPrompt && installPrompt . prompt } ) ; }
A Hook that implements the awaitInstallPrompt() lifecycle and returns
 an object that contains the isStandalone and installPrompt props:
A Hook that implements the awaitInstallPrompt () lifecycle and returns an object that contains the isStandalone and installPrompt props :