# renderToHtmlString

Renders a stream of `RenderEvent`s into a single HTML string.

This is a convenience function that collects all events from `renderToHtml` and joins them
into a single string. It is an Effect that resolves when the stream completes.

## Signatures

```ts
export declare function renderToHtmlString<const T extends Renderable.Any>(renderable: T): Effect.Effect<string, Renderable.Error<T>, Renderable.Services<T>>;
```

## Why

This is the finite-response convenience over `renderToHtml`: it preserves
ordered chunks but buffers them when the caller needs one complete body.

## Ownership and lifetime

The returned Effect runs and finalizes the source Fx. The resulting string is
caller-owned; errors and required services remain in the Effect type.

## Cost model

Collection requires memory proportional to the complete rendered response.
Prefer `renderToHtml` when the transport can stream chunks.

## Examples

```ts
import { Effect } from "effect"
import { html } from "@typed/template"
import { renderToHtmlString, HtmlRenderTemplate } from "@typed/template/Html"

const program = Effect.scoped(Effect.gen(function* () {
  const template = html`<div>
    <h1>Hello</h1>
    <p>World</p>
  </div>`

  // Render to single HTML string
  const htmlString = yield* renderToHtmlString(template).pipe(
    Effect.provide(HtmlRenderTemplate)
  )

  console.log(htmlString)
  // "<div><h1>Hello</h1><p>World</p></div>"
}))
```
