Open kosich opened 3 years ago
This allows adding functions on the proxy fields (fix #3)
E.g.:
interface Extension { readValue<S>(this:S): S extends ObservableProxy<infer A, unknown> ? A : never; } const x: Extension = { readValue() { return this⦠} } const source = proxify(of({ a: 1 }, { a: 2 }), x); const d = source.a.readValue() // d: number
This might be handy if combined with rxjs-autorun:
// RxJS :: Autorun + Proxify const s = statify({ a: 'π°', b: 'π‘' }); autorun(() => s.b.$() + s.a._()); //π‘π° s.b.next('πΈ'); //πΈπ°
I don't quite like the typing output and code should be refactored to include this feature. Also, it's not clear at what level should this extension be applied and when dropped (observable/subject/behaviorSubject)
This allows adding functions on the proxy fields (fix #3)
E.g.:
This might be handy if combined with rxjs-autorun:
I don't quite like the typing output and code should be refactored to include this feature. Also, it's not clear at what level should this extension be applied and when dropped (observable/subject/behaviorSubject)