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
5
5
slug : /core/computed
6
6
---
7
7
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
9
9
its value from a specified function.
10
10
Computed States are a powerful concept,
11
11
that 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"
56
56
MY_NAME .set (' hans' );
57
57
MY_COMPUTED .value ; // ✅ Returns "My name is 'hans' and I am 10 years old"
58
58
```
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
- ```
74
59
75
60
## 🔨 Use case
76
61
A ` 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,
11
11
which aren't directly related to the [ ` State Class ` ] ( ../state/Introduction.md ) .
12
12
13
13
The 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 ` ) .
15
15
These State related methods aren't described in this Section.
16
16
To find out more about specific State methods,
17
17
check out the [ State documentation] ( ../state/Introduction.md ) .
You can’t perform that action at this time.
0 commit comments