Overview of Other State Management Features
In addition to the component state and application state management mentioned in previous topics, ArkTS also provides @Watch, $$ and @Track for state management.
-
@Watch listens for the changes of state variables.
-
$$operator provides a TS variable by-reference to a built-in component so that the variable value and the internal state of that component are kept in sync.
-
@Track applies to attribute-level updates of class objects. When a property decorated by @Track changes, only the UI associated with the property is updated.
-
Freezing a Custom Component represents that the component is inactive and its state variable does not respond to updates.
你可能感兴趣的鸿蒙文章
harmony 鸿蒙@AnimatableExtend Decorator: Definition of Animatable Attributes
harmony 鸿蒙Application State Management Overview
harmony 鸿蒙AppStorage: Storing Application-wide UI State
harmony 鸿蒙Basic Syntax Overview
harmony 鸿蒙@Builder Decorator: Custom Builder Function
harmony 鸿蒙@BuilderParam Decorator: Referencing the @Builder Function
harmony 鸿蒙Creating a Custom Component
harmony 鸿蒙Mixing Use of Custom Components
harmony 鸿蒙Constraints on Access Modifiers of Custom Component Member Variables