MCPcopy Create free account
hub / github.com/activejs/activejs / asObservable

Method asObservable

packages/core/src/lib/selection.ts:28–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26 }
27
28 asObservable(): Observable<T | undefined> {
29 if (this.unit.config.immutable === true) {
30 // allows to optimize cases when the whole value is not new,
31 // e.g.: updating property 'a' in a DictUnit using 'set',
32 // wouldn't trigger paths that start with property 'b'
33 return this.unit.pipe(
34 map(() => plucker(this.unit.rawValue(), this.path)),
35 distinctUntilChanged(),
36 map(() => plucker((this.unit as any).emittedValue, this.path))
37 );
38 }
39
40 return this.unit.pipe(
41 map(value => plucker(value, this.path)),
42 distinctUntilChanged()
43 );
44 }
45}

Callers 7

abstract-base.tsFile · 0.80
constructorFunction · 0.80
getFunction · 0.80
units.spec.tsFile · 0.80
action.spec.tsFile · 0.80
cluster.spec.tsFile · 0.80
selection.spec.tsFile · 0.80

Calls 1

pluckerFunction · 0.90

Tested by

no test coverage detected