From 68f6039fbe8e87e3a13f745c78140315f18a5cf4 Mon Sep 17 00:00:00 2001 From: Simon Friis Vindum Date: Tue, 20 Aug 2019 13:47:03 +0200 Subject: [PATCH] Fix flatMap and flatten types --- src/component.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/component.ts b/src/component.ts index c2614d4..84da745 100644 --- a/src/component.ts +++ b/src/component.ts @@ -58,10 +58,10 @@ export abstract class Component implements Monad { of

(p: P): Component<{}, P> { return new OfComponent(p); } - flatMap

(f: (o: O) => Component): Component { + flatMap(f: (o: O) => Component): Component { return new FlatMapComponent(this, f); } - chain

(f: (o: O) => Component): Component { + chain(f: (o: O) => Component): Component { return new FlatMapComponent(this, f); } output

(f: (a: A) => P): Component; @@ -91,7 +91,7 @@ export abstract class Component implements Monad { multi: boolean = false; abstract run(parent: DomApi, destroyed: Future): Out; // Definitions below are inserted by Jabz - flatten: () => Component; + flatten: (this: Component>) => Component; map:

(f: (a: O) => P) => Component; mapTo:

(b: P) => Component; ap:

(a: Component P>) => Component; @@ -177,10 +177,10 @@ export function output( */ export const emptyComponent = Component.of({}); -class FlatMapComponent extends Component { +class FlatMapComponent extends Component { constructor( private readonly component: Component, - private readonly f: (o: O) => Component + private readonly f: (o: O) => Component ) { super(); }