Skip to content

Commit c7ca63d

Browse files
committed
Observable. Observable.reduce (#2776)
1 parent efdbc41 commit c7ca63d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

kotlin-web/src/commonMain/kotlin/web/observable/Observable.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ external class Observable<T : JsAny?>(
4848

4949
fun <R : JsAny?> map(transform: (T) -> R): Observable<R>
5050

51-
// fun reduce(Reducer reducer, optional any initialValue, options: SubscribeOptions? = definedExternally) : Promise<any>
51+
fun <U : JsAny?> reduce(
52+
operation: (previousValue: U, currentValue: T, currentIndex: Int) -> U,
53+
initialValue: U,
54+
options: SubscribeOptions? = definedExternally,
55+
): Promise<U>
5256

5357
fun some(
5458
predicate: (T) -> Boolean,

0 commit comments

Comments
 (0)