mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-24 14:51:09 +08:00
Component decorators (#354)
Add decorator variants for decorator components Add the "pipe" operator for components, similar to what was done for Elements. We are able to put something like: ``` Button(...) | Maybe(&show_button) ``` Add decorators for: - `Maybe` - `CatchEvent` - `Renderer` Signed-off-by: Kefu Chai <tchaikov@gmail.com> Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
This commit is contained in:
@@ -84,7 +84,7 @@ int main(int argc, const char* argv[]) {
|
||||
return window(text("keys"), vbox(std::move(children)));
|
||||
});
|
||||
|
||||
component = CatchEvent(component, [&](Event event) {
|
||||
component |= CatchEvent([&](Event event) {
|
||||
keys.push_back(event);
|
||||
return true;
|
||||
});
|
||||
|
Reference in New Issue
Block a user