AsyncTemplatePiece
A single interpolated segment in asyncTemplate.
- Primitives use
String(value)for output, except that values matchingvalue === null || value === undefined || value === falseyield no text (early return inprocessTemplatePiece). Other falsy values such as0or''are still stringified. - Arrays are flattened recursively in order.
- Promises are awaited; the resolved value is processed the same way.
- Async iterables of primitives are streamed in order; each yielded value uses the same rules as a standalone primitive (
String(...), withnull/undefined/falseomitted). - Functions (thunks): if the piece is a function, it is invoked with no arguments (
piece()), and the return value is processed recursively—so you can defer work or return any other AsyncTemplatePiece shape (see MaybeFn). At runtime a thunk may also return aPromiseof a piece; that is covered by MaybePromise on each template interpolation.
