Skip to content
This repository was archived by the owner on Feb 15, 2025. It is now read-only.

Commit 28b9951

Browse files
committed
fixed typos
1 parent 7a9afb8 commit 28b9951

File tree

4 files changed

+94
-23
lines changed

4 files changed

+94
-23
lines changed

docs/packages/core/features/collection/Introduction.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,15 +269,16 @@ which gives us much more freedom in configuring them.
269269
<br/>
270270

271271
#### `key`
272-
The `key/name` is an optional property that is used to identify the Collection later.
273-
Such `key` is pretty useful during debug sessions or if we [persist](./Methods.md#persist) our Collection,
274-
it automatically uses the Collection `key` as persist key.
275-
We recommend giving each Collection a unique `key`, since it has only advantages.
272+
The optional property `key/name` should be a unique `string/number` to identify the Collection later.
276273
```ts
277274
const MY_COLLECTION = App.createCollection({
278275
key: "myKey"
279276
});
280277
```
278+
We recommend giving each Collection a unique `key`, since it has only advantages:
279+
- helps us during debug sessions
280+
- makes it easier to identify the Collection
281+
- no need for separate persist Key
281282

282283
<br/>
283284

docs/packages/core/features/collection/group/Introduction.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ MY_GROUP.value; // Returns '[1, 2, 3]'
104104

105105
### `config`
106106

107-
Beside the initial îtemKeys a `Collection` takes an optional configuration object.
107+
Beside the initial îtemKeys a `Group` takes an optional configuration object.
108108
```ts
109109
const MY_GROUP = MY_COLLECTION.createGroup([1, 2, 3], {
110110
key: "myGroup",
@@ -122,15 +122,16 @@ export interface GroupConfigInterface {
122122
<br/>
123123

124124
#### `key`
125-
The `key/name` is an optional property that is used to identify the Group later.
126-
Such `key` is pretty useful during debug sessions or if we [persist](../../state/Methods.md#persist) our Group,
127-
it automatically uses the Group `key` as persist key.
128-
We recommend giving each Collection a unique `key`, since it has only advantages.
125+
The optional property `key/name` should be a unique `string/number` to identify the Group later.
129126
```ts
130127
const MY_GROUP = MY_COLLECTION.createGroup([1, 2, 3], {
131128
key: "myKey"
132129
});
133130
```
131+
We recommend giving each Group a unique `key`, since it has only advantages:
132+
- helps us during debug sessions
133+
- makes it easier to identify the Collection
134+
- no need for separate persist Key
134135

135136
<br/>
136137

@@ -142,16 +143,24 @@ This property is mainly thought for internal use.
142143

143144
:::
144145

145-
With `isPlaceholder` we tell our Group that it's a placeholder.
146-
Often Groups are `placeholder` when AgileTs needs to hold a reference to it,
147-
although the Group doesn't official exists and hasn't been instantiated yet.
146+
Defines whether the Group is an `placeholder` or not.
148147
```ts
149-
const MY_STATE = App.createState("myInitialValue", {
148+
const MY_GROUP = App.createGroup([1, 2, 3], {
150149
isPlaceholder: true
151150
});
152151

153-
MY_STATE.exists(); // false
152+
MY_GROUP.exists(); // false
154153
```
154+
Groups are, for example, `placeholder` when AgileTs needs to hold a reference to them,
155+
although they aren't instantiated yet.
156+
This might be the case by using `getGroupWithReference()`,
157+
where AgileTs returns a `placeholder` Group, if the Group doesn't exist,
158+
to hold a reference to the not existing Group.
159+
```ts
160+
useAgile(getGroupWithReference(1));
161+
```
162+
This reference is important to rerender the Component,
163+
whenever the Group got instantiated.
155164

156165

157166
## 🟦 Typescript

docs/packages/core/features/collection/selector/Introduction.md

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,70 @@ Test the Selector yourself, it's only one click away. Just select your preferred
7676
## 📭 Props
7777

7878
### `itemKey`
79-
TODO
79+
The `itemKey` of the Item the Selector represents
80+
```ts {1}
81+
const MY_SELECTOR = MY_COLLECTION.createSelector(1);
82+
```
8083

8184
### `config`
82-
TODO
85+
86+
Beside the initial itemKey a `Selector` takes an optional configuration object.
87+
```ts
88+
const MY_SELECTOR = MY_COLLECTION.createSelector(1, {
89+
key: "mySelector",
90+
});
91+
```
92+
Here is a Typescript Interface for quick reference. However,
93+
each property is explained in more detail below.
94+
```ts
95+
export interface SelectorConfigInterface {
96+
key?: SelectorKey;
97+
isPlaceholder?: boolean;
98+
}
99+
```
100+
101+
<br/>
102+
103+
#### `key`
104+
The optional property `key/name` should be a unique `string/number` to identify the Selector later.
105+
```ts
106+
const MY_GROUP = MY_COLLECTION.createGroup([1, 2, 3], {
107+
key: "myKey"
108+
});
109+
```
110+
We recommend giving each Selector a unique `key`, since it has only advantages:
111+
- helps us during debug sessions
112+
- makes it easier to identify the Collection
113+
- no need for separate persist Key
114+
115+
<br/>
116+
117+
#### `isPlaceholder`
118+
119+
:::warning
120+
121+
This property is mainly thought for internal use.
122+
123+
:::
124+
125+
Defines whether the Selector is an `placeholder` or not.
126+
```ts
127+
const MY_SELECTOR = App.creaateSelector(1, {
128+
isPlaceholder: true
129+
});
130+
131+
MY_SELECTOR.exists(); // false
132+
```
133+
Selector are, for example, `placeholder` when AgileTs needs to hold a reference to them,
134+
although they aren't instantiated yet.
135+
This might be the case by using `getSelectorWithReference()`,
136+
where AgileTs returns a `placeholder` Selector, if the Selector doesn't exist,
137+
to hold a reference to the not existing Selector.
138+
```ts
139+
useAgile(getSelectorWithReference(1));
140+
```
141+
This reference is important to rerender the Component,
142+
whenever the Selector got instantiated.
83143

84144

85145
## 🟦 Typescript

docs/packages/core/features/state/Introduction.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,16 @@ export interface StateConfigInterface {
9595
<br/>
9696

9797
#### `key`
98-
The `key/name` is an optional property that is used to identify the State later.
99-
Such `key` is pretty useful during debug sessions or if we [persist](./Methods.md#persist) our State,
100-
it automatically uses the State `key` as persist key.
101-
We recommend giving each State a unique `key`, since it has only advantages.
98+
The optional property `key/name` should be a unique `string/number` to identify the State later.
10299
```ts
103100
const MY_STATE = App.createState("myInitialValue", {
104101
key: "myKey"
105102
});
106103
```
104+
We recommend giving each State a unique `key`, since it has only advantages:
105+
- helps us during debug sessions
106+
- makes it easier to identify the Collection
107+
- no need for separate persist Key
107108

108109
<br/>
109110

@@ -134,16 +135,16 @@ This property is mainly thought for internal use.
134135

135136
:::
136137

137-
With `isPlaceholder` we tell our State that it's a placeholder.
138-
Often States are `placeholder` when AgileTs needs to hold a reference to it,
139-
although the State doesn't official exists and hasn't been instantiated yet.
138+
Defines whether the State is an `placeholder` or not.
140139
```ts
141140
const MY_STATE = App.createState("myInitialValue", {
142141
isPlaceholder: true
143142
});
144143

145144
MY_STATE.exists(); // false
146145
```
146+
States are, for example, `placeholder` when AgileTs needs to hold a reference to them,
147+
although they aren't instantiated yet.
147148

148149
## 🟦 Typescript
149150

0 commit comments

Comments
 (0)