import { Subject , sync } from 'most-subject' ; import { get , set } from '../helpers' ; export function createProxySinks < Sinks extends object > ( sinks = { } as Sinks , disposableSubject = sync < void > ( ) ) { return new Proxy < Sinks > ( sinks , { get ( target , property ) { if ( ! get ( target , property ) ) set ( target , property , sync < any > ( ) ) ; return get ( target , property ) . until ( disposableSubject ) ; } , has ( ) { return true ; } } ) ; }