import { ActionType } from '@ulangi/ulangi-action' ; import { EventBus , on } from '@ulangi/ulangi-event' ; export class VocabularyEventDelegate { private eventBus : EventBus ; public constructor ( eventBus ) { this . eventBus = eventBus ; } public onVocabularyChange ( callback ) { this . eventBus . subscribe ( on ( [ ActionType . VOCABULARY__ADD_SUCCEEDED , ActionType . VOCABULARY__ADD_MULTIPLE_SUCCEEDED , ActionType . VOCABULARY__DOWNLOAD_VOCABULARY_SUCCEEDED , ActionType . VOCABULARY__DOWNLOAD_INCOMPATIBLE_VOCABULARY_SUCCEEDED , ] , callback ) ) ; } public onDownloadVocabularyCompleted ( callback ) { this . eventBus . subscribe ( on ( [ ActionType . VOCABULARY__DOWNLOAD_VOCABULARY_SUCCEEDED , ActionType . VOCABULARY__DOWNLOAD_INCOMPATIBLE_VOCABULARY_SUCCEEDED , ] , callback ) ) ; } }