This repository was archived by the owner on Feb 15, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +2
-17
lines changed
docs/packages/core/api/computed Expand file tree Collapse file tree 2 files changed +2
-17
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ sidebar_label: Introduction
55slug : /core/computed
66---
77
8- A ` Computed ` is an extension of the ` State Class ` that computes
8+ A ` Computed ` is an extension of the [ ` State Class ` ] ( ../state/Introduction.md#-light-state ) that computes
99its value from a specified function.
1010Computed States are a powerful concept,
1111that lets us build dynamic data depending on other data.
@@ -56,21 +56,6 @@ MY_COMPUTED.value; // Returns "My name is 'jeff' and I am 10 years old"
5656MY_NAME .set (' hans' );
5757MY_COMPUTED .value ; // ✅ Returns "My name is 'hans' and I am 10 years old"
5858```
59- Since the Computed Class is an extension of the [ State Class] ( ../state/Introduction.md ) ,
60- it offers the same powerful functionalities as a normal State.
61- ``` ts
62- // Check if the Computed value is equal to 'Hello World'
63- MY_COMPUTED .is (" Hello World" );
64-
65- // Check if the Computed State 'exists'
66- MY_COMPUTED .exists ();
67- ```
68- Want to learn more about the Computed State's specific methods?
69- Check out the [ Computed Methods] ( ./Methods.md ) documentation.
70- Most methods we use to modify, mutate and access the Computed are chainable.
71- ``` ts
72- MY_COMPUTED .recompute ().ingest ();
73- ```
7459
7560## 🔨 Use case
7661A ` Computed State ` is useful whenever we need a State that is computed depending on other States.
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ Here are valuable methods of the `Computed Class` listed,
1111which aren't directly related to the [ ` State Class ` ] ( ../state/Introduction.md ) .
1212
1313The Computed is an extension of the [ ` State Class ` ] ( ../state/Introduction.md )
14- and offers the same methods as a normal State.
14+ and offers the same methods as a normal State ( ` Light State ` ) .
1515These State related methods aren't described in this Section.
1616To find out more about specific State methods,
1717check out the [ State documentation] ( ../state/Introduction.md ) .
You can’t perform that action at this time.
0 commit comments