import { Effects , runWith } from '@typed/effects' ; import { HookEffects , HookEnvironment } from './types' ; export function * runWithHooks < A , B > ( effect , hookEnvironment ) { yield * hookEnvironment . resetId ( ) ; if ( hookEnvironment . updated ) { yield * hookEnvironment . clearUpdated ( ) ; } const value = yield * runWith ( effect , { hookEnvironment } ) as Effects < A , B > ; return value ; }