diff --git a/src/observable/map/ApplyMap.ts b/src/observable/map/ApplyMap.ts index 4f79a9df..4dbbc3d3 100644 --- a/src/observable/map/ApplyMap.ts +++ b/src/observable/map/ApplyMap.ts @@ -36,22 +36,6 @@ export class ApplyMap extends BaseObservableMap { this._config = config(); } - join(...otherMaps: Array): JoinedMap { - return this._config.join(this, ...otherMaps); - } - - mapValues(mapper: Mapper, updater?: Updater): MappedMap { - return this._config.mapValues(this, mapper, updater); - } - - sortValues(comparator: Comparator): SortedMapList { - return this._config.sortValues(this, comparator); - } - - filterValues(filter: Filter): FilteredMap { - return this._config.filterValues(this, filter); - } - hasApply() { return !!this._apply; } @@ -118,6 +102,23 @@ export class ApplyMap extends BaseObservableMap { get(key: K) { return this._source.get(key); } + + join(...otherMaps: Array): JoinedMap { + return this._config.join(this, ...otherMaps); + } + + mapValues(mapper: Mapper, updater?: Updater): MappedMap { + return this._config.mapValues(this, mapper, updater); + } + + sortValues(comparator: Comparator): SortedMapList { + return this._config.sortValues(this, comparator); + } + + filterValues(filter: Filter): FilteredMap { + return this._config.filterValues(this, filter); + } + } type Apply = (key: K, value: V, params?: any) => void; \ No newline at end of file diff --git a/src/observable/map/FilteredMap.ts b/src/observable/map/FilteredMap.ts index 4e3f8ee6..782a67fe 100644 --- a/src/observable/map/FilteredMap.ts +++ b/src/observable/map/FilteredMap.ts @@ -35,22 +35,6 @@ export class FilteredMap extends BaseObservableMap { this._config = config(); } - join(...otherMaps: Array): JoinedMap { - return this._config.join(this, ...otherMaps); - } - - mapValues(mapper: Mapper, updater?: Updater): MappedMap{ - return this._config.mapValues(this, mapper, updater); - } - - sortValues(comparator: Comparator): SortedMapList { - return this._config.sortValues(this, comparator); - } - - filterValues(filter: Filter): FilteredMap { - return this._config.filterValues(this, filter); - } - setFilter(filter: Filter) { this._filter = filter; if (this._subscription) { @@ -178,6 +162,22 @@ export class FilteredMap extends BaseObservableMap { return value; } } + + join(...otherMaps: Array): JoinedMap { + return this._config.join(this, ...otherMaps); + } + + mapValues(mapper: Mapper, updater?: Updater): MappedMap{ + return this._config.mapValues(this, mapper, updater); + } + + sortValues(comparator: Comparator): SortedMapList { + return this._config.sortValues(this, comparator); + } + + filterValues(filter: Filter): FilteredMap { + return this._config.filterValues(this, filter); + } } class FilterIterator { diff --git a/src/observable/map/JoinedMap.ts b/src/observable/map/JoinedMap.ts index 67a85368..2be95bdf 100644 --- a/src/observable/map/JoinedMap.ts +++ b/src/observable/map/JoinedMap.ts @@ -33,22 +33,6 @@ export class JoinedMap extends BaseObservableMap { this._config = config(); } - join(...otherMaps: Array): JoinedMap { - return this._config.join(this, ...otherMaps); - } - - mapValues(mapper: Mapper, updater?: Updater): MappedMap { - return this._config.mapValues(this, mapper, updater); - } - - sortValues(comparator: Comparator): SortedMapList { - return this._config.sortValues(this, comparator); - } - - filterValues(filter: Filter): FilteredMap { - return this._config.filterValues(this, filter); - } - onAdd(source: BaseObservableMap, key: K, value: V) { if (!this._isKeyAtSourceOccluded(source, key)) { const occludingValue = this._getValueFromOccludedSources(source, key); @@ -149,6 +133,23 @@ export class JoinedMap extends BaseObservableMap { } return undefined; } + + join(...otherMaps: Array): JoinedMap { + return this._config.join(this, ...otherMaps); + } + + mapValues(mapper: Mapper, updater?: Updater): MappedMap { + return this._config.mapValues(this, mapper, updater); + } + + sortValues(comparator: Comparator): SortedMapList { + return this._config.sortValues(this, comparator); + } + + filterValues(filter: Filter): FilteredMap { + return this._config.filterValues(this, filter); + } + } class JoinedIterator implements Iterator<[K, V]> { diff --git a/src/observable/map/LogMap.ts b/src/observable/map/LogMap.ts index 44b0a59c..6f3bf676 100644 --- a/src/observable/map/LogMap.ts +++ b/src/observable/map/LogMap.ts @@ -38,22 +38,6 @@ export class LogMap extends BaseObservableMap { this._config = config(); } - join(...otherMaps: Array): JoinedMap { - return this._config.join(this, ...otherMaps); - } - - mapValues(mapper: Mapper, updater?: Updater): MappedMap { - return this._config.mapValues(this, mapper, updater); - } - - sortValues(comparator: Comparator): SortedMapList { - return this._config.sortValues(this, comparator); - } - - filterValues(filter: Filter): FilteredMap { - return this._config.filterValues(this, filter); - } - private log(labelOrValues: LabelOrValues, logLevel?: LogLevel): ILogItem { return this._log.log(labelOrValues, logLevel); } @@ -101,4 +85,21 @@ export class LogMap extends BaseObservableMap { get(key: K) { return this._source.get(key); } + + join(...otherMaps: Array): JoinedMap { + return this._config.join(this, ...otherMaps); + } + + mapValues(mapper: Mapper, updater?: Updater): MappedMap { + return this._config.mapValues(this, mapper, updater); + } + + sortValues(comparator: Comparator): SortedMapList { + return this._config.sortValues(this, comparator); + } + + filterValues(filter: Filter): FilteredMap { + return this._config.filterValues(this, filter); + } + } diff --git a/src/observable/map/MappedMap.ts b/src/observable/map/MappedMap.ts index 950273ec..396802bb 100644 --- a/src/observable/map/MappedMap.ts +++ b/src/observable/map/MappedMap.ts @@ -46,22 +46,6 @@ export class MappedMap extends BaseObservableMap { this._config = config(); } - join(...otherMaps: Array): JoinedMap { - return this._config.join(this, ...otherMaps); - } - - mapValues(mapper: Mapper, updater?: Updater): MappedMap{ - return this._config.mapValues(this, mapper, updater); - } - - sortValues(comparator: Comparator): SortedMapList { - return this._config.sortValues(this, comparator); - } - - filterValues(filter: Filter): FilteredMap { - return this._config.filterValues(this, filter); - } - _emitSpontaneousUpdate(key: K, params: any) { const value = this._mappedValues.get(key); if (value) { @@ -128,4 +112,20 @@ export class MappedMap extends BaseObservableMap { get(key: K): V | undefined { return this._mappedValues.get(key); } + + join(...otherMaps: Array): JoinedMap { + return this._config.join(this, ...otherMaps); + } + + mapValues(mapper: Mapper, updater?: Updater): MappedMap{ + return this._config.mapValues(this, mapper, updater); + } + + sortValues(comparator: Comparator): SortedMapList { + return this._config.sortValues(this, comparator); + } + + filterValues(filter: Filter): FilteredMap { + return this._config.filterValues(this, filter); + } } \ No newline at end of file diff --git a/src/observable/map/ObservableMap.ts b/src/observable/map/ObservableMap.ts index 1be7b2c1..6ce6ea91 100644 --- a/src/observable/map/ObservableMap.ts +++ b/src/observable/map/ObservableMap.ts @@ -32,22 +32,6 @@ export class ObservableMap extends BaseObservableMap { this._values = new Map(initialValues); } - join(...otherMaps: Array): JoinedMap { - return this._config.join(this, ...otherMaps); - } - - mapValues(mapper: Mapper, updater?: Updater): MappedMap { - return this._config.mapValues(this, mapper, updater); - } - - sortValues(comparator: Comparator): SortedMapList { - return this._config.sortValues(this, comparator); - } - - filterValues(filter: Filter): FilteredMap { - return this._config.filterValues(this, filter); - } - update(key: K, params?: any): boolean { const value = this._values.get(key); if (value !== undefined) { @@ -115,6 +99,22 @@ export class ObservableMap extends BaseObservableMap { keys(): Iterator { return this._values.keys(); } + + join(...otherMaps: Array): JoinedMap { + return this._config.join(this, ...otherMaps); + } + + mapValues(mapper: Mapper, updater?: Updater): MappedMap { + return this._config.mapValues(this, mapper, updater); + } + + sortValues(comparator: Comparator): SortedMapList { + return this._config.sortValues(this, comparator); + } + + filterValues(filter: Filter): FilteredMap { + return this._config.filterValues(this, filter); + } }; export function tests() {