This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Theoretical framework for a UI library in Zig that mirrors a bit of what React does | |
const std = @import("std"); | |
fn Store(T: type) type { | |
return struct { | |
value: T, | |
fn setValue(self: *@This(), value: T) void { | |
self.value = value; | |
// TODO: Call back to the framework to start re-rendering |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
const sfy = @import("structify.zig"); | |
pub fn main() !void { | |
// Object builders just like c# or typescript, easy peasy! Tooling could be better. | |
{ | |
const Config = struct { | |
a: i32, | |
b: i16, |