import { inject , lifeCycleObserver , LifeCycleObserver , ValueOrPromise , } from '@loopback/core' ; import { juggler } from '@loopback/repository' ; const config = { name : 'notifDb' , connector : 'memory' , localStorage : '' , file : '' , } ; @ lifeCycleObserver ( 'datasource' ) export class NotificationDbDataSource extends juggler . DataSource implements LifeCycleObserver { static dataSourceName = 'NotifDb' ; constructor ( @ inject ( 'datasources.config.NotifDb' , { optional : true } ) dsConfig = config ) { super ( dsConfig ) ; } /**
     * Start the datasource when application is started
     */ start ( ) { } /**
     * Disconnect the datasource when application is stopped. This allows the
     * application to be shut down gracefully.
     */ stop ( ) { return super . disconnect ( ) ; } }