datastar/sdk/zig
Roman Frołow 5a4b4d699e
Accomodate Zig SDK and examples to test runner changes (#601)
* update zig to work on master

* Updated deps, fixed to use tests.zig as root, add datastar as module, refactoring

* Update test_runner.zig. Move tests to root.zig.

* tokamak: use post0 when no body
2025-02-05 09:39:00 -06:00
..
httpz Accomodate Zig SDK and examples to test runner changes (#601) 2025-02-05 09:39:00 -06:00
src elide retry if default (#578) 2025-02-02 21:19:32 -06:00
tokamak Accomodate Zig SDK and examples to test runner changes (#601) 2025-02-05 09:39:00 -06:00
.gitignore Zig SDK framework integration + hello-world examples (#546) 2025-01-28 12:48:06 -06:00
README.md Zig SDK framework integration + hello-world examples (#546) 2025-01-28 12:48:06 -06:00
build.zig Zig SDK framework integration + hello-world examples (#546) 2025-01-28 12:48:06 -06:00
build.zig.zon Zig SDK framework integration + hello-world examples (#546) 2025-01-28 12:48:06 -06:00
test_runner.zig Accomodate Zig SDK and examples to test runner changes (#601) 2025-02-05 09:39:00 -06:00

README.md

Datastar Zig SDK

An implementation of the Datastar SDK in Zig with framework integration for http.zig and tokamak.

Testing

Run zig build test.

Usage

const datastar = @import("datastar");

// Creates a new `ServerSentEventGenerator`.
var sse = try datastar.ServerSentEventGenerator.init(res);

// Merges HTML fragments into the DOM.
try sse.mergeFragments("<div id='question'>What do you put in a toaster?</div>", .{});

// Merges signals into the signals.
try sse.mergeSignals("{response: '', answer: 'bread'}", .{});