()
| 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 | } |
no test coverage detected