State Management Terms
A
Attribute-Level Updates
The state management framework uses the class attribute decorator to observe attributes in class objects. When an attribute changes, only the component bound to the attribute is updated. The components bound to other attributes that do not change are not updated.
D
Data Source
Original source of a state variable, which can be synchronized to different state data. Generally, it is the data passed from the parent component to the child component.
Deep Monitor
The @Monitor decorator is used to listen to data changes. In-depth listening recursively monitors all nested attributes of objects or arrays.
Deep Observation
The deep observation capability means that the UI can recursively observe all nested attributes of an object or an array.
L
Local Initialization
Assigns a value to a variable when the variable is declared, as the default value of the variable.
M
Mark Dirty
When a state variable changes, the framework will mark the system components that depend on this variable and the custom component to which this variable belongs as "dirty". In the subsequent UI rendering process, the dirty nodes will be refreshed.
Minimum Updates
Minimum Updates is an optimization policy of the UI framework. It ensures that only the changed part is updated, that is, only the system components bound to the changed state variables are updated, avoiding unnecessary rendering operations.
N
Named Parameter Mechanism
The parent component passes the state variable to the child component by specifying parameters. This is the main method for passing synchronous parameters between the parent and child components.
O
One-Layer Monitor
@The Watch decorator is used to listen to data changes. One-layer monitor can only listen to the changes of the top-level attributes of objects or arrays. It does not listen to nested attributes recursively.
One-Layer Observation
The UI can observe the changes of the one-layer attributes of the state variables decorated by the V1 decorator, such as @State and @Prop.
One-Way Sync
Data can flow only in one direction, usually from a parent component to a child component. A child component can receive data from its parent component, but cannot directly modify the data source of its parent component.
R
Reference Transmission
When a function is called or a variable is assigned a value, the variable itself is transferred, including the logic of Collecting Dependencies and Triggering Updates.
Regular Variables
A variable that is not decorated by a state decorator and is usually used for auxiliary calculation. Its value change will not trigger UI re-renders.
Render Phase
The render phase is a phase in the state management triggering updates. It refers to the process of refreshing the UI after the component marking dirty is complete and the next frame signal arrives. In this process, the framework traverses the dirty custom component list, calls the rerender method generated by the system, traverses dirty system components, refreshes components, and updates dependencies.
S
State Variables
Variable decorated by the state decorator. The change of the state variable value causes the UI rendering update.
T
Trailing Lambda
Tail closure is a syntax feature of ArkTS. When a closure is used as the last parameter of a function, the closure expression can be written after the function call parenthesis to improve code readability.
Two-way Sync
Data can flow in two directions, and parent and child components can modify each other.
V
Value Transmission
When a function is called or a value is assigned to a variable, the value of the variable instead of the variable itself is transferred. The logic for collecting dependencies and triggering updates is not included.
View
A view refers to a UI.
你可能感兴趣的鸿蒙文章
openharmony 鸿蒙 arkts-new-makeObserved
openharmony 鸿蒙 arkts-new-param
openharmony 鸿蒙 arkts-state-management-introduce
openharmony 鸿蒙 properly-use-state-management-to-develope
openharmony 鸿蒙 arkts-new-persistencev2
openharmony 鸿蒙 arkts-v1-v2-migration-application
openharmony 鸿蒙 arkts-v1-v2-migration-reusable
openharmony 鸿蒙 arkts-page-custom-components-lifecycle