import { MonoTypeOperatorFunction , pipe } from "rxjs" ; import { first , skipWhile } from "rxjs/operators" ; /**
 * Waits until the state of a source observable is equal to the given
 * state, then emit that state. All other states are discarded.
 * <br/>After the state has changed to the desired state, subsequent states
 * are let through. if this desire is not intended, use the  filter function
 *  param state export function waitForChangeTo < State > ( state ) { return pipe ( skipWhile ( ( nextState ) => nextState !== state ) , first ( ) ) ; }