feat(core): Add QueryList#forEach

This commit is contained in:
laco0416
2016-01-08 15:34:25 +09:00
committed by Matias Niemela
parent c1a0af514f
commit b634a25ae0
2 changed files with 12 additions and 0 deletions

View File

@ -51,6 +51,11 @@ export class QueryList<T> {
*/
reduce<U>(fn: (acc: U, item: T) => U, init: U): U { return this._results.reduce(fn, init); }
/**
* executes function for each element in a query.
*/
forEach(fn: (item: T) => void): void { this._results.forEach(fn); }
/**
* converts QueryList into an array
*/