feat: selected's children
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user