datastar_wisp

Package Version Hex Docs

Wisp adaptor for https://hexdocs.pm/datastar

gleam add datastar datastar_wisp
import datastar/ds_sse
import datastar/ds_wisp

let events = [
  ds_sse.merge_fragments("<span>Hello</span>")
  |> ds_sse.merge_fragments_selector("#notice")
  |> ds_sse.merge_fragments_end,
]

wisp.ok()
|> ds_wisp.send(events)

This will add the events data to the Wisp response. And will also add the expected headers by Datastar.

Search Document