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

Commit cd7303d

Browse files
committed
fixed some typos
1 parent cd88d1a commit cd7303d

File tree

1 file changed

+103
-14
lines changed

1 file changed

+103
-14
lines changed

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

Lines changed: 103 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ Some of them are listed below:
3434
| `value` | string \| number \| undefined | undefined | New Key/Name of Collection | Yes |
3535

3636
### 📄 Return
37+
38+
```ts
39+
Collection
40+
```
3741
Returns the [Collection](./Introduction.md) it was called on.
3842

3943

@@ -87,6 +91,10 @@ MY_COLLECTION.createGroup('myGroup', ['item1', 'item2']);
8791
| `config` | [GroupConfig](../../../../Interfaces.md#groupconfig) | {} | Configuration | No |
8892

8993
### 📄 Return
94+
95+
```ts
96+
Group
97+
```
9098
Returns a fresh [Group](./group/Introduction.md).
9199

92100

@@ -141,6 +149,10 @@ MY_COLLECTION.createSelector('mySelector', 'toSelectKey');
141149
| `config` | [SelectorConfig](../../../../Interfaces.md#selectorconfig) | {} | Configuration | No |
142150

143151
### 📄 Return
152+
153+
```ts
154+
Selector
155+
```
144156
Returns a fresh [Selector](./selector/Introduction.md).
145157

146158

@@ -180,7 +192,6 @@ and binds them to the Collection.
180192
and binds them to the Collection. It also takes care creating the `default` Group,
181193
which is like an interface to all collected data.
182194

183-
184195
:::
185196

186197

@@ -270,6 +281,9 @@ App.createCollection({
270281

271282
### 📄 Return
272283

284+
```ts
285+
Collection
286+
```
273287
Returns the [Collection](./Introduction.md) it was called on.
274288

275289

@@ -329,6 +343,9 @@ MY_COLLECTION.update(1, {name: "frank"}, {patch: {addNewProperties: false}}); //
329343

330344
### 📄 Return
331345

346+
```ts
347+
Collection
348+
```
332349
Returns the [Collection](./Introduction.md) it was called on.
333350

334351

@@ -384,6 +401,9 @@ and trigger a rerender on all subscribed UI-Components whenever the missing Item
384401

385402
### 📄 Return
386403

404+
```ts
405+
Group
406+
```
387407
Returns a fresh [Group](./group/Introduction.md).
388408

389409

@@ -414,6 +434,9 @@ MY_COLLECTION.hasGroup('group6'); // Returns true
414434

415435
### 📄 Return
416436

437+
```ts
438+
boolean
439+
```
417440
`true` if the Group exists and `false` if the Group doesn't exist.
418441

419442

@@ -454,7 +477,10 @@ Such reference allows AgileTs to rerender the UI-Component, whenever the missing
454477

455478
### 📄 Return
456479

457-
A Group fitting to the passed `groupKey` or `undefined`.
480+
```ts
481+
Group | undefined
482+
```
483+
A [Group](./group/Introduction.md) fitting to the passed `groupKey` or `undefined`.
458484

459485

460486

@@ -491,7 +517,10 @@ const myGroupWithReference = useAgile(MY_COLLECTION.getGroupWithReferenece('myGr
491517

492518
### 📄 Return
493519

494-
A Group fitting to the passed `groupKey` or a `placeholder` Group.
520+
```ts
521+
Group
522+
```
523+
A [Group](./group/Introduction.md) fitting to the passed `groupKey` or a `placeholder` Group.
495524

496525

497526

@@ -518,6 +547,9 @@ MY_COLLECTION.removeGroup('myGroup');
518547

519548
### 📄 Return
520549

550+
```ts
551+
Collection
552+
```
521553
Returns the [Collection](./Introduction.md) it was called on.
522554

523555

@@ -566,6 +598,9 @@ const MY_SELECTOR = MY_COLLECTION.select('itemKey');
566598

567599
### 📄 Return
568600

601+
```ts
602+
Selector
603+
```
569604
Returns a fresh [Selector](./selector/Introduction.md).
570605

571606

@@ -600,6 +635,9 @@ MY_SELECOTR.key; // Returns 'itemKey'
600635

601636
### 📄 Return
602637

638+
```ts
639+
Selector
640+
```
603641
Returns a fresh [Selector](./selector/Introduction.md).
604642

605643

@@ -630,6 +668,9 @@ MY_COLLECTION.hasSelector('selector8'); // Returns true
630668

631669
### 📄 Return
632670

671+
```ts
672+
boolean
673+
```
633674
Returns `true` if the Selector exists and `false` if the Selector doesn't exist.
634675

635676

@@ -670,7 +711,10 @@ Such reference allows AgileTs to rerender the UI-Component, whenever the missing
670711

671712
### 📄 Return
672713

673-
A Selector fitting to the passed `selectorKey` or `undefined`.
714+
```ts
715+
Selector | undefined
716+
```
717+
A [Selector](./selector/Introduction.md) fitting to the passed `selectorKey` or `undefined`.
674718

675719

676720

@@ -707,7 +751,10 @@ const mySelectorWithReference = useAgile(MY_COLLECTION.getSelectorWithReferenece
707751

708752
### 📄 Return
709753

710-
A Selector fitting to the passed `selectorKey` or a `placeholder` Selector.
754+
```ts
755+
Selector
756+
```
757+
A [Selector](./selector/Introduction.md) fitting to the passed `selectorKey` or a `placeholder` Selector.
711758

712759

713760

@@ -734,6 +781,9 @@ MY_COLLECTION.removeSelector('mySelector');
734781

735782
### 📄 Return
736783

784+
```ts
785+
Collection
786+
```
737787
Returns the [Collection](./Introduction.md) it was called on.
738788

739789

@@ -764,6 +814,9 @@ MY_COLLECTION.hasItem(1); // Returns true
764814

765815
### 📄 Return
766816

817+
```ts
818+
boolean
819+
```
767820
`true` if the Item exists and `false` if the Item doesn't exist.
768821

769822

@@ -804,7 +857,10 @@ Such reference allows AgileTs to rerender the UI-Component, whenever the missing
804857

805858
### 📄 Return
806859

807-
An Item fitting to the passed `itemKey` or `undefined`.
860+
```ts
861+
Item | undefined
862+
```
863+
An [Item](./Introduction.md#-item) fitting to the passed `itemKey` or `undefined`.
808864

809865

810866

@@ -841,7 +897,10 @@ const myItemWithReference = useAgile(MY_COLLECTION.getItemWithReferenece('myItem
841897

842898
### 📄 Return
843899

844-
An Item fitting to the passed `itemKey` or a `placeholder` Item.
900+
```ts
901+
Item
902+
```
903+
An [Item](./Introduction.md#-item) fitting to the passed `itemKey` or a `placeholder` Item.
845904

846905

847906

@@ -875,6 +934,9 @@ MY_COLLECTION.getAllItems(); // Returns something like (see below)
875934

876935
### 📄 Return
877936

937+
```ts
938+
Array<Item>
939+
```
878940
All Items of the Collection.
879941

880942

@@ -909,6 +971,9 @@ MY_COLLECTION.getAllItemValues(); // Returns something like (see below)
909971

910972
### 📄 Return
911973

974+
```ts
975+
Array<DataType> // DataType is by default '{[key: string]: any}'
976+
```
912977
All Item `values` of the Collection.
913978

914979

@@ -997,6 +1062,10 @@ By `default`, it will be stored in the `default` Storage.
9971062
| `config` | [StatePersistentConfig](../../../../Interfaces.md#statepersistentconfig) | {} | Configuration | No |
9981063

9991064
### 📄 Return
1065+
1066+
```ts
1067+
Collection
1068+
```
10001069
Returns the [Collection](./Introduction.md) it was called on.
10011070

10021071

@@ -1028,6 +1097,9 @@ the persisted value got loaded.
10281097

10291098
### 📄 Return
10301099

1100+
```ts
1101+
Collection
1102+
```
10311103
Returns the [Collection](./Introduction.md) it was called on.
10321104

10331105

@@ -1052,7 +1124,9 @@ since each Collection has a `default` Group.
10521124

10531125
### 📄 Return
10541126

1055-
`number`
1127+
```ts
1128+
number
1129+
```
10561130

10571131

10581132

@@ -1074,7 +1148,9 @@ MY_COLLECTION.getSelectorCount(); // Returns 1
10741148

10751149
### 📄 Return
10761150

1077-
`number`
1151+
```ts
1152+
number
1153+
```
10781154

10791155

10801156

@@ -1102,6 +1178,9 @@ MY_COLLECTION.reset(); //️ Collection Data is empty
11021178

11031179
### 📄 Return
11041180

1181+
```ts
1182+
Collection
1183+
```
11051184
Returns the [Collection](./Introduction.md) it was called on.
11061185

11071186

@@ -1137,6 +1216,9 @@ Now `itemKey1`, `itemKey2`, `itemKey3` will be added to the Groups at `groupKey1
11371216

11381217
### 📄 Return
11391218

1219+
```ts
1220+
Collection
1221+
```
11401222
Returns the [Collection](./Introduction.md) it was called on.
11411223

11421224

@@ -1173,6 +1255,9 @@ It takes care of:
11731255

11741256
### 📄 Return
11751257

1258+
```ts
1259+
Collection
1260+
```
11761261
Returns the [Collection](./Introduction.md) it was called on.
11771262

11781263

@@ -1204,7 +1289,9 @@ MY_COLLECTION.getGroupKeysThatHaveItemKey('itemKey1'); // Returns '['group1']'
12041289
### 📄 Return
12051290

12061291
Returns an Array of `itemKeys` and if it couldn't find any `itemKey` it returns an empty Array.
1207-
1292+
```ts
1293+
Array<number | string>
1294+
```
12081295

12091296

12101297
<br />
@@ -1220,31 +1307,33 @@ Returns an Array of `itemKeys` and if it couldn't find any `itemKey` it returns
12201307
With `remove()` we are able to remove Item/s from
12211308

12221309
- ### `everywhere()`
1223-
Removes the Item/s at `itemKey/s` from the whole Collection and all Groups/Selectors, so from everywhere.
1310+
Removes the Item/s at `itemKey/s` from the whole Collection and all [Groups](./group/Introduction.md) / [Selectors](./selector/Introduction.md),
1311+
so from everywhere.
12241312
```ts
12251313
MY_COLLECTION.remove('item1').everywhere();
12261314
```
12271315

12281316
- ### `fromGroups()`
1229-
Removes the Item/s at `itemKey/s` only from specific Groups.
1317+
Removes the Item/s at `itemKey/s` only from specific [Groups](./group/Introduction.md).
12301318
```ts
12311319
MY_COLLECTION.remove('item1').fromGroups(['group1', 'group2']);
12321320
```
12331321

12341322
:::info
12351323

12361324
Be aware that a standalone `remove()` doesn't do anything,
1237-
so we have always to add `everywhere()` or `fromGroups()`.
1325+
so we always have to add `.everywhere()` or `.fromGroups()`.
12381326

12391327
:::
12401328

12411329
### 📭 Props
12421330

12431331
| Prop | Type | Default | Description | Required |
12441332
|----------------------|-----------------------------------------------------------------------------------|------------|-----------------------------------------------------------------------------------------------|----------|
1245-
| `itemKeys` | number \| string | Array<number \| string \> | undefined | itemKey/s that get removed | Yes |
1333+
| `itemKeys` | number \| string | Array<number \| string\> | undefined | itemKey/s that get removed | Yes |
12461334

12471335
### 📄 Return
1336+
12481337
```ts
12491338
{
12501339
fromGroups: (groups: Array<ItemKey> | ItemKey) => this;

0 commit comments

Comments
 (0)