import { DatabaseEvent , DatabaseEventBus } from '@ulangi/ulangi-local-database' ; import { EventChannel , eventChannel } from 'redux-saga' ; export class DatabaseEventChannel { private databaseEventBus : DatabaseEventBus ; public constructor ( databaseEventBus ) { this . databaseEventBus = databaseEventBus ; } public createChannel ( ) { return eventChannel ( ( emit ) : ( ( ) => void ) => { return this . databaseEventBus . subscribe ( ( databaseEvent ) : void => { emit ( databaseEvent ) ; } ) ; } ) ; } }