Skip to content

Commit 0201b92

Browse files
committed
perf(scan): fast-path for scanning scalars
1 parent aca2d37 commit 0201b92

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/observables/ScalarObservable.ts

+4
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,8 @@ export default class ScalarObservable<T> extends Observable<T> {
8585
return new ScalarObservable(result);
8686
}
8787
}
88+
89+
scan<R>(project: (acc: R, x: T) => R, acc?: R): Observable<R> {
90+
return this.reduce(project, acc);
91+
}
8892
}

0 commit comments

Comments
 (0)