import PageSetup from './setup/PageSetup' ; import checkSetupEnv from './checkSetupEnv' ; export default function usePageEvents < F extends keyof tinyapp . IPageEvents > ( name , fn ) { checkSetupEnv ( 'usePageLifeCycle' , [ 'page' ] ) ; const setup = PageSetup . getCurrent < PageSetup > ( ) ; setup . addMethod ( `events.${ name }` as any , fn ) ; }