import { Observable } from 'rxjs' ; export const createChanges$ = < T > ( db , options = { since : 'now' , live : true , include_docs : true } ) => new Observable < PouchDB . Core . ChangesResponseChange < T > > ( ( observer ) => { const changes = db . changes ( options ) . on ( 'change' , ( change ) => { observer . next ( change ) ; } ) . on ( 'error' , ( error ) => { observer . error ( error ) ; } ) . on ( 'complete' , ( ) => { observer . complete ( ) ; } ) ; return ( ) => changes . cancel ( ) ; } ) ;