diff --git a/src/observable/map/ApplyMap.js b/src/observable/map/ApplyMap.js index 1a2976ac..feab968c 100644 --- a/src/observable/map/ApplyMap.js +++ b/src/observable/map/ApplyMap.js @@ -82,4 +82,8 @@ export class ApplyMap extends BaseObservableMap { get size() { return this._source.size; } + + get(key) { + return this._source.get(key); + } } diff --git a/src/observable/map/BaseObservableMap.js b/src/observable/map/BaseObservableMap.js index 61de18dc..79df21f6 100644 --- a/src/observable/map/BaseObservableMap.js +++ b/src/observable/map/BaseObservableMap.js @@ -49,4 +49,9 @@ export class BaseObservableMap extends BaseObservable { get size() { throw new Error("unimplemented"); } + + // eslint-disable-next-line no-unused-vars + get(key) { + throw new Error("unimplemented"); + } } diff --git a/src/observable/map/FilteredMap.js b/src/observable/map/FilteredMap.js index e164aae3..290dcea6 100644 --- a/src/observable/map/FilteredMap.js +++ b/src/observable/map/FilteredMap.js @@ -128,6 +128,13 @@ export class FilteredMap extends BaseObservableMap { }); return count; } + + get(key) { + const value = this._source.get(key); + if (value && this._filter(value, key)) { + return value; + } + } } class FilterIterator {