feat(core): add the find method to QueryList

This commit is contained in:
Thomas Shafer
2016-10-26 16:14:34 -07:00
committed by vsavkin
parent a318b57257
commit 7c16ef942e
3 changed files with 17 additions and 0 deletions

View File

@ -57,6 +57,12 @@ export class QueryList<T>/* implements Iterable<T> */ {
return this._results.filter(fn);
}
/**
* See
* [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)
*/
find(fn: (item: T, index: number, array: T[]) => boolean): T { return this._results.find(fn); }
/**
* See
* [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)