From f90737e488e4c5eb8bc098a485feb0209236cab0 Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Fri, 26 Feb 2021 15:15:05 +0000 Subject: [PATCH] fix(until): allow non Promise values in type --- src/until.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/until.ts b/src/until.ts index 0e0566e..04626c1 100644 --- a/src/until.ts +++ b/src/until.ts @@ -3,8 +3,8 @@ import {directive} from './directive' import type {TemplatePart} from '@github/template-parts' const untils: WeakMap = new WeakMap() -export const until = directive>>( - (...promises: Array>) => (part: TemplatePart) => { +export const until = directive( + (...promises: unknown[]) => (part: TemplatePart) => { if (!untils.has(part)) untils.set(part, {i: promises.length}) const state = untils.get(part)! for (let i = 0; i < promises.length; i += 1) { @@ -23,3 +23,5 @@ export const until = directive>>( } } ) + +until(Promise.resolve(true), true)