diff --git a/src/remote-data.ts b/src/remote-data.ts index 682f9e4..c776abc 100644 --- a/src/remote-data.ts +++ b/src/remote-data.ts @@ -177,7 +177,12 @@ export class RemoteInitial { * * rest of example is similar to `fold` */ - foldL(initial: Lazy, pending: Lazy, failure: Function1, success: Function1): B { + foldL( + initial: Lazy, + pending: Function1, B>, + failure: Function1, + success: Function1, + ): B { return initial(); } @@ -441,7 +446,12 @@ export class RemoteFailure { return failure(this.error); } - foldL(initial: Lazy, pending: Lazy, failure: Function1, success: Function1): B { + foldL( + initial: Lazy, + pending: Function1, B>, + failure: Function1, + success: Function1, + ): B { return failure(this.error); } @@ -553,7 +563,12 @@ export class RemoteSuccess { return success(this.value); } - foldL(initial: Lazy, pending: Lazy, failure: Function1, success: Function1): B { + foldL( + initial: Lazy, + pending: Function1, B>, + failure: Function1, + success: Function1, + ): B { return success(this.value); } @@ -670,8 +685,13 @@ export class RemotePending { return pending; } - foldL(initial: Lazy, pending: Lazy, failure: Function1, success: Function1): B { - return pending(); + foldL( + initial: Lazy, + pending: Function1, B>, + failure: Function1, + success: Function1, + ): B { + return pending(this.progress); } getOrElseL(f: Lazy): A {