feat: selected's children

This commit is contained in:
2025-05-28 18:07:25 +02:00
parent a884c2066f
commit 53b93bad64
4 changed files with 229 additions and 52 deletions

View File

@@ -1,15 +1,20 @@
pub fn Observable(T: type) type {
return struct {
allocator: std.mem.Allocator,
observers: std.ArrayList(*const Observer(T)),
const Self = @This();
pub fn init(allocator: std.mem.Allocator) Self {
return .{
.allocator = allocator,
.observers = std.ArrayList(*const Observer(T)).init(allocator),
};
}
pub fn deinit(self: *Self) void {
for(self.observers)|o| {
self.allocator.destroy(o);
}
self.observers.deinit();
}