import { IEventDispatcher } from "../../../events/api/IEventDispatcher" ; import { LifecycleEvent } from "../../../framework/api/LifecycleEvent" ; import { EventRelay } from "./EventRelay" ; private export class LifecycleEventRelay { private static TYPES : string [ ] = [ LifecycleEvent . STATE_CHANGE , LifecycleEvent . PRE_INITIALIZE , LifecycleEvent . INITIALIZE , LifecycleEvent . POST_INITIALIZE , LifecycleEvent . PRE_SUSPEND , LifecycleEvent . SUSPEND , LifecycleEvent . POST_SUSPEND , LifecycleEvent . PRE_RESUME , LifecycleEvent . RESUME , LifecycleEvent . POST_RESUME , LifecycleEvent . PRE_DESTROY , LifecycleEvent . DESTROY , LifecycleEvent . POST_DESTROY ] ; private _relay : EventRelay ; private constructor ( source , destination ) { this . _relay = new EventRelay ( source , destination , LifecycleEventRelay . TYPES ) . start ( ) ; } private public destroy ( ) { this . _relay . stop ( ) ; this . _relay = null ; } }