Add binding - #52
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (9)
📝 WalkthroughSummary by CodeRabbitRelease Notes
WalkthroughIntroduces a typed ChangesTyped Handle, Binding System, and Fluent Builder
Sequence Diagram(s)sequenceDiagram
rect rgba(100, 149, 237, 0.5)
Note over Caller,FynixCtx: Build phase
Caller->>FynixCtx: add~Label~() / compose~TextButton~()
FynixCtx-->>Caller: ElementCtx~'f, W, E~
Caller->>ElementCtx: bind(fps_changed, get_fps, set_text)
ElementCtx->>Bindings: add(Binding~W~)
end
rect rgba(144, 238, 144, 0.5)
Note over Fynix,Elements: Frame update phase
Fynix->>Bindings: snapshot_changed(world)
Bindings-->>Fynix: Vec~Binding~W~~
loop each changed binding
Fynix->>Binding: apply(elements, world)
Binding->>Elements: get_typed_mut~E~(id)
Binding->>Elements: mark_dirty(id)
end
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Unlike a reactive (which allows you to mutate an entire subtree), a binding allows you to only mutate a single element.
The example now uses binding instead of reactive to reduce unnecessary computation.