import { useEffect } from 'react' ; import { useRouteMatch } from 'react-router' ; import { load } from '@proton/shared/lib/api/core/load' ; import useApi from './useApi' ; const useLoad = ( ) => { const api = useApi ( ) ; const { path } = useRouteMatch ( ) ; useEffect ( ( ) => { api ( { ... load ( path ) , silence : true } ) ; } , [ ] ) ; } ; export default useLoad ;