feat: Add a callback style reflect decorator#1263
Conversation
The reflect decorator force user to update the layout at next epoch, this may cause problem if the user want to update the layout immediately. This change adds a callback style reflect decorator, which will call the callback immediately with the layout information. But here comes a risk that it may or may not cause infinite update and render loop.
|
Thanks!
What about: App::PostEventOrExecute(callback);It will post the callback in the task queue to be executed after the current task. |
Why
|
…inite layout loops
This pull request adds a callback-style reflect decorator to FTXUI.
The reflect decorator force user to update the layout at next epoch,
this may cause problem if the user want to update the layout immediately.
This change adds a callback style reflect decorator, which will call the
callback immediately with the layout information. But here comes a risk
that it may or may not cause infinite update and render loop.
A better solution is to defer the callback after the render process, I
am not sure how to achieve it yet, leave it for future discussion.