Add extendable map class #13261
Labels
area-core-library
SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
closed-obsolete
Closed as the reported issue is no longer relevant
core-n
type-enhancement
A request for a change that isn't a bug
It'd be useful to have a standard way in the SDK to extend Map. This way, it can be reused across SDK and community packages. It'd also be useful to specify which type of map you want to use. For instance:
class ExtendableMap<K, V> implements Map {
Map<K, V> _map = new HashMap();
ExtendableMap();
ExtendableMap.use(this._map);
void operator []=(K key, V value) {
_map[key] = value;
}
}
Then in subclasses:
class CustomMap extends ExtendableMap {
CustomMap() : super.use(new LinkedHashMap());
}
See discussion here: https://groups.google.com/a/dartlang.org/forum/#!topic/misc/Sj3guf3es24.
The text was updated successfully, but these errors were encountered: