import * as Rx from "rxjs" ; import * as A from "./atom" ; import * as RxOps from "rxjs/operators" ; import { unmount , HarmajaOutput , HarmajaStaticOutput } from "../harmaja" ; export function testRender < T > ( init , test ) { const subject = new Rx . BehaviorSubject < T > ( init ) ; const element = test ( subject , ( value ) => subject . next ( value ) ) ; unmount ( element as HarmajaStaticOutput ) ; expect ( subject . observers . length ) . toEqual ( 0 ) ; } export type Property < T > = Rx . Observable < T > ; export type Atom < T > = A . Atom < T > ; export type EventStream < T > = Rx . Observable < T > ; export const atom = A . atom ; export function constant < A > ( value ) { return new Rx . BehaviorSubject ( value ) ; } export function map < A , B > ( observable , fn ) { return observable . pipe ( RxOps . map ( fn ) ) ; }