import { ActionType , createAction } from '@ulangi/ulangi-action' ; import { SyncTask } from '@ulangi/ulangi-common/enums' ; import { EventBus } from '@ulangi/ulangi-event' ; import { boundClass } from 'autobind-decorator' ; import * as _ from 'lodash' ; @ boundClass export class SynchronizerScreenDelegate { private eventBus : EventBus ; public constructor ( eventBus ) { this . eventBus = eventBus ; } public triggerSync ( ) { _ . values ( SyncTask ) . forEach ( ( syncTask ) : void => { this . eventBus . publish ( createAction ( ActionType . SYNC__ADD_SYNC_TASK , { syncTask : syncTask as SyncTask , } ) ) ; } ) ; } }