Skip to content
This repository was archived by the owner on Jan 9, 2025. It is now read-only.

Commit f90737e

Browse files
committed
fix(until): allow non Promise values in type
1 parent 4d42680 commit f90737e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/until.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import {directive} from './directive'
33
import type {TemplatePart} from '@github/template-parts'
44

55
const untils: WeakMap<TemplatePart, {i: number}> = new WeakMap()
6-
export const until = directive<Array<Promise<unknown>>>(
7-
(...promises: Array<Promise<unknown>>) => (part: TemplatePart) => {
6+
export const until = directive(
7+
(...promises: unknown[]) => (part: TemplatePart) => {
88
if (!untils.has(part)) untils.set(part, {i: promises.length})
99
const state = untils.get(part)!
1010
for (let i = 0; i < promises.length; i += 1) {
@@ -23,3 +23,5 @@ export const until = directive<Array<Promise<unknown>>>(
2323
}
2424
}
2525
)
26+
27+
until(Promise.resolve(true), true)

0 commit comments

Comments
 (0)