import { Observable } from 'rxjs/internal/Observable' ; import { useMemo } from 'react' ; import { MutableObserver } from './mutable-observer' ; import { useRx } from './use-rx' ; param observable$ param next export function useRxEffect < T > ( observable$ , next ) { const observer = useMemo ( ( ) => new MutableObserver ( ) , [ observable$ ] ) ; observer . setNext ( next ) ; useRx ( observable$ , observer ) ; }