license import { Observer , } from 'indefinite-observable' ; import { stub , } from 'sinon' ; export default function createMockObserver < T > ( ) { return new MockObserver < T > ( ) ; } export class MockObserver < T > { next ? : Function ; disconnect = stub ( ) ; connect = ( observer ) => { this . next = observer . next . bind ( observer ) ; return this . disconnect ; } ; }