-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
Description
This issue was originally filed by @seaneagan
A method on Collection to find the first of it's elements which matches a predicate would be useful:
E find(bool predicate(E item)) {
var filtered = filter(predicate);
if(filtered.isEmpty) return null; // throw instead ?
return filtered.iterator().next();
};
it might also make sense to rename Collection#filter to Collection#findAll since "filter" seems to have a mutative connotation.
Metadata
Metadata
Assignees
Labels
area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.