fix Iterator vs IterableIterator confusion
This commit is contained in:
parent
de8995fa7e
commit
8c3ae57497
2 changed files with 3 additions and 3 deletions
|
@ -35,7 +35,7 @@ export function defaultObserverWith<T>(overrides: { [key in keyof IListObserver<
|
|||
return Object.assign(defaults, overrides);
|
||||
}
|
||||
|
||||
export abstract class BaseObservableList<T> extends BaseObservable<IListObserver<T>> {
|
||||
export abstract class BaseObservableList<T> extends BaseObservable<IListObserver<T>> implements Iterable<T> {
|
||||
emitReset() {
|
||||
for(let h of this._handlers) {
|
||||
h.onReset(this);
|
||||
|
@ -69,6 +69,6 @@ export abstract class BaseObservableList<T> extends BaseObservable<IListObserver
|
|||
}
|
||||
}
|
||||
|
||||
abstract [Symbol.iterator]();
|
||||
abstract [Symbol.iterator](): Iterator<T>;
|
||||
abstract get length(): number;
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ export class Range {
|
|||
return range.start < this.end && this.start < range.end;
|
||||
}
|
||||
|
||||
forEachInIterator<T>(it: IterableIterator<T>, callback: ((T, i: number) => void)) {
|
||||
forEachInIterator<T>(it: Iterator<T>, callback: ((T, i: number) => void)) {
|
||||
let i = 0;
|
||||
for (i = 0; i < this.start; i += 1) {
|
||||
it.next();
|
||||
|
|
Reference in a new issue