-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
type: enhancementNew feature or requestNew feature or request
Description
Description
The current implementation stores values like x, y, layoutX, layoutY, visible, etc. as standard fields. This makes it impossible to listen for changes.
Instead, those values should be stored inside observable states. This enables listening for changes and reacting accordingly, such as firing updates, triggering re-renders, etc.
Some states should be read-only, such as x, y, since they're calculated based on other values.
Motivation
This is motivated by #19. AnvilGui should support an observable text input field.
Expected Code
// getters and setter persist:
node.setLayoutX(x);
node.getLayoutX();
// states can be accessed and observed:
node.layoutXState().observe((oldValue, newValue) ->{
// ...
});
// read-only states can't be set:
node.xState().set(x); // won't compileMetadata
Metadata
Assignees
Labels
type: enhancementNew feature or requestNew feature or request