Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
ObservableList.sublist does not return an ObservableList #13965
This issue was originally filed by @butlermatt
This used to work correctly in web_ui, but as I port my project over to Polymer I'm finding that ObservableList.sublist() does not return an ObservableList. I instead have to wrap the return of sublist in toObservable.
// This throws an exception
Uncaught Error: type 'List' is not a subtype of type 'ObservableList' of 'function result'.
// This works
we generally don't try to preserve observable-ness in all accessors, as that would greatly complicate ObservableList/Map impls. We'd need to know about every sublist, iterable, etc, and propagate change notifications. While it's a very neat idea and I support someone taking it on :-), we don't really have bandwidth. (and Object.observe in JS doesn't support it either, for similar reasons).
OTOH, if we fix https://code.google.com/p/dart/issues/detail?id=16342 it will essentially work again (using dirty checking like Web UI did).
Added NotPlanned label.