Skip to content

Commit 004b488

Browse files
committed
#6888 Core Concepts Recap fix
1 parent 295e9ed commit 004b488

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

learn/guides/ConfigSystemDeepDive.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ At its heart, the config system is built on a few key principles:
1414
* **`static config` Block:** All configurable properties of a class are declared in a `static config = {}` block.
1515
This provides a single, clear source of truth for a class's API.
1616
* **`_` Suffix Convention:** Config properties that require custom logic when they change are declared with a trailing
17-
underscore (e.g., `myValue_`). This signals the framework to automatically generate a getter, a setter, and a
18-
`beforeSet` / `afterSet` hook for it.
19-
* **Auto-Generated Methods:** For a config like `myValue_`, the framework creates:
20-
* `getMyValue()`: A public getter.
21-
* `setMyValue()`: A public setter.
22-
* `beforeSetMyValue(value, oldValue)`: A hook called before the value is set.
23-
* `afterSetMyValue(value, oldValue)`: A hook called after the value has been set.
17+
underscore (e.g., `myValue_`). This signals the framework to automatically create a native getter and setter on the
18+
class's prototype for this property.
19+
* **Lifecycle Hooks:** For a config like `myValue_`, the framework provides optional lifecycle hooks that you can
20+
implement in your class:
21+
* `beforeGetMyValue(value)`: Called before the getter returns the value.
22+
* `beforeSetMyValue(value, oldValue)`: Called before the setter applies the new value.
23+
* `afterSetMyValue(value, oldValue)`: Called after the setter has applied the new value.
2424
* **Reactivity:** The `afterSet` hooks are the heart of the reactive system. They allow you to define logic that
2525
automatically runs whenever a specific config property changes, ensuring your UI and application state are always
2626
in sync.

0 commit comments

Comments
 (0)