From c09bc2d09199ce7711b04fe08bf8a208306344f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Yves=20G=C3=A9rardy?= Date: Wed, 27 May 2020 22:01:52 +0200 Subject: [PATCH] Better type signature for S.root --- dist/es/S.d.ts | 3 ++- dist/es/withsubclocks.d.ts | 1 + src/S.ts | 3 ++- src/withsubclocks.ts | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dist/es/S.d.ts b/dist/es/S.d.ts index 672cee0..fc5ae2e 100644 --- a/dist/es/S.d.ts +++ b/dist/es/S.d.ts @@ -1,5 +1,6 @@ export interface S { - root(fn: (dispose?: () => void) => T): T; + root(fn: (dispose: () => void) => T): T; + root(fn: () => T): T; (fn: () => T): () => T; (fn: (v: T) => T, seed: T): () => T; on(ev: () => any, fn: () => T): () => T; diff --git a/dist/es/withsubclocks.d.ts b/dist/es/withsubclocks.d.ts index 5a17966..2e0ddd3 100644 --- a/dist/es/withsubclocks.d.ts +++ b/dist/es/withsubclocks.d.ts @@ -1,5 +1,6 @@ export interface S { root(fn: (dispose: () => void) => T): T; + root(fn: () => T): T; (fn: () => T): () => T; (fn: (v: T) => T, seed: T): () => T; on(ev: () => any, fn: () => T): () => T; diff --git a/src/S.ts b/src/S.ts index c131107..78ab307 100644 --- a/src/S.ts +++ b/src/S.ts @@ -1,6 +1,7 @@ export interface S { // Computation root - root(fn : (dispose? : () => void) => T) : T; + root(fn : (dispose : () => void) => T) : T; + root(fn : () => T) : T; // Computation constructors (fn : () => T) : () => T; diff --git a/src/withsubclocks.ts b/src/withsubclocks.ts index b4d2751..9cf25a4 100644 --- a/src/withsubclocks.ts +++ b/src/withsubclocks.ts @@ -2,6 +2,7 @@ export interface S { // Computation root root(fn : (dispose : () => void) => T) : T; + root(fn : () => T) : T; // Computation constructors (fn : () => T) : () => T;