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

Commit 6b49b21

Browse files
committed
fixed typos
1 parent 14eeb12 commit 6b49b21

File tree

6 files changed

+203
-80
lines changed

6 files changed

+203
-80
lines changed

docs/Interfaces.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ export interface UpdateConfigInterface {
681681

682682
If the update data object should be merged into the existing data or overwrite it completely.
683683
In case we want to merge the data into the existing data,
684-
we can decide wether new properties are added to the data object or not.
684+
we can decide whether new properties are added to the data object or not.
685685
```ts {2}
686686
MY_COLLECTION.collect({id: 1, name: "jeff"});
687687
MY_COLLECTION.update(1, {name: "hans", age: 12}, {patch: {addNewProperties: false}}); // Item at '1' has value '{name: "hans"}'

docs/packages/core/features/agile-instance/Introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ since there the `localStorage` doesn't exists. With `App.registerStorage()` we c
103103

104104
#### `waitForMount`
105105

106-
This flag declares wether AgileTs should wait until unmounted
106+
This flag declares whether AgileTs should wait until unmounted
107107
components get mounted before rerendering them.
108108
```ts
109109
const App = new Agile({

docs/packages/core/features/agile-instance/Methods.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ const Event = App.createEvent({
149149
### 📄 Return
150150

151151
```ts
152-
Events
152+
Event
153153
```
154154
Returns a fresh [Event](../event/Introduction.md).
155155

@@ -166,11 +166,11 @@ Returns a fresh [Event](../event/Introduction.md).
166166
## `integrate()`
167167

168168
With `integrate()` we can integrate any Framework [Integration](../integration/Introduction.md) into AgileTs.
169-
An Integration simply tells AgileTs, how it has to mutate a specific Component,
170-
whenever a State changes. In order binding States to Components and thus be reactive,
171-
each Framework using AgileTs needs an Integration for AgileTs.
172-
For instance to use AgileTs in a [React](https://reactjs.org/) environment,
173-
we have to integrate a React Integration into AgileTs.
169+
An Integration simply tells AgileTs, howto mutate a particular Component,
170+
whenever a State changes. To bind States to Components and thus be reactive,
171+
any Framework using AgileTs needs an Integration for AgileTs.
172+
For example, to use AgileTs in a [React](https://reactjs.org/) environment,
173+
we have to register a React Integration to AgileTs.
174174
```ts
175175
App.integrate(reactIntegration);
176176
```
@@ -250,7 +250,8 @@ boolean
250250
## `createStorage()`
251251

252252
Creates a new [Storage](../storage/Introduction.md) Interface for AgileTs,
253-
which allows AgileTs to work with the Storage, the Interface represents.
253+
that allows AgileTs to work with the Storage that the Interface represents.
254+
The Interface allows AgileTs to permanently store States in the Storage.
254255
```ts
255256
const Storage = App.createStorage({
256257
key: 'dummyStorage',
@@ -290,13 +291,13 @@ Returns a fresh [Storage](../storage/Introduction.md).
290291

291292
## `registerStorage()`
292293

293-
Registers a new [Storage](../storage/Introduction.md) Interface to AgileTs,
294-
which later can store persisted Instances ([`.persist()`](../state/Methods.md)).
295-
The [Local Storage](https://developer.mozilla.org/de/docs/Web/API/Window/localStorage) is registered by default.
296-
Below you can see how the localStorage is registered internally.
294+
Registers a new [Storage](../storage/Introduction.md) Interface to AgileTs.
295+
It is used to permanently store persisted Instances ([`.persist()`](../state/Methods.md)) in the Storage that the Interface represents.
296+
By default, the [Local Storage](https://developer.mozilla.org/de/docs/Web/API/Window/localStorage) is registered.
297+
Below you can see how the `localStorage` is registered internally.
297298
```ts {13}
298-
// Here we create our Storage
299-
const _localStorage = new Storage({
299+
// create localStorage Interface with help of the Agile Storage
300+
const _localStorage = App.createStorage({
300301
key: 'localStorage',
301302
async: false,
302303
methods: {
@@ -306,7 +307,7 @@ const _localStorage = new Storage({
306307
},
307308
});
308309

309-
// Here we register our Storage
310+
// Register Storage to current Agile Instance (App)
310311
App.register(_localStorage, { default: true });
311312
```
312313

@@ -336,7 +337,7 @@ Returns the [Agile Instance](./Introduction.md) it was called from
336337
## `hasStorage()`
337338

338339
Checks if AgileTs has any registered [Storage](../storage/Introduction.md).
339-
If AgileTs couldn't find any Storage, we aren't able to use the `.persist()` functionality in any Agile Sub Instance.
340+
If AgileTs couldn't find any Storage, the `.persist()` method can not store any value permanently.
340341

341342
### 📄 Return
342343

docs/packages/core/features/agile-instance/Properties.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,22 @@ Here useful properties of the `Agile Instance` are described.
1313

1414
## `logger`
1515

16-
The `logger` is a static property of the `Agile Class`.
17-
It is an Instance of a handy Class that gets used to Log something in the console, like warnings, errors.
18-
Feel free to use the Agile Logger in your Application for logging too,
19-
it is pretty handy.
16+
The `logger` is a static property of the `Agile Class`,
17+
which is internally used to Log warnings, errors, messages, .. into the console.
2018
```ts
2119
Agile.logger.warn("This is a Warning");
2220
Agile.logger.log("This is a normal Log");
2321
Agile.logger.if.tag(["render"]).warn("Logs this Warning if the Logger has the Tag 'rerender' active");
2422
```
23+
![Log Custom Styles Example](../../../../../static/img/docs/logger_example.png)
24+
It can be configured during the creation of the `Agile Class`.
25+
```ts
26+
const App = new Agile({
27+
logConfig: {
28+
level: Logger.level.WARN,
29+
active: true,
30+
timestamp: true
31+
}
32+
})
33+
```
2534

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

Lines changed: 60 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -988,25 +988,27 @@ All Item `values` of the Collection.
988988

989989
## `persist()`
990990

991-
With `persist()` we preserve the State Value in the appropriate local storage for the current environment.
992-
No matter if Mobile or Web environment as long as we have configured our [Storage](../storage/Introduction.md) correctly.
991+
Preserves Collection Value in the appropriate local storage for the current environment.
992+
No matter if Mobile or Web environment as long as the [Storage](../storage/Introduction.md) Interface is configured correctly.
993993
```ts
994994
MY_COLLECTION.perist("myPersistKey");
995995
```
996996

997997
### 💻 Web
998-
Most people persisting something in a web environment, use the [Local Storage](https://www.w3schools.com/html/html5_webstorage.asp).
998+
In a web environment it is common to use the [Local Storage](https://www.w3schools.com/html/html5_webstorage.asp) to permanently store a specific value
999999
Luckily AgileTs has already set up the Local Storage by default.
10001000
```ts {2}
10011001
const App = new Agile({
10021002
localStorage: true
10031003
})
10041004
```
1005+
So we can use the `persist()` method out of the box.
10051006

10061007
### 📱 Mobile
10071008
In a mobile environment the Local Storage doesn't exist,
1008-
so we have to use an alternative like the [Async Storage](https://reactnative.dev/docs/asyncstorage).
1009-
The Async Storage isn't registered to AgileTs by default, so we have to do it on our own.
1009+
so we need an alternative like the [Async Storage](https://reactnative.dev/docs/asyncstorage).
1010+
The Async Storage isn't setup by default, so we need create a [Storage](../storage/Introduction.md) Interface
1011+
and register it to AgileTs on our own.
10101012
```ts {3-9}
10111013
App.registerStorage(
10121014
App.createStorage({
@@ -1022,11 +1024,12 @@ App.registerStorage(
10221024
```
10231025

10241026
### 🔑 Local Storage Key
1025-
For persisting a Collection we have two options to provide the required `storage key`.
1027+
To persist a Collection we need a `storage key`, which is used to identify the stored value later.
1028+
There are two ways to provide such required `storage key` to the `persist()` method.
10261029

1027-
- **1.** Assign a unique key to the Collection,
1028-
because if no key has been passed into the `persist()` function,
1029-
it uses the Collection key as `storage key`.
1030+
- **1.** Assign a unique key to the Collection itself.
1031+
Because if no key is given to the `persist()` function,
1032+
it takes the Collection key as `storage key`.
10301033
```ts {2}
10311034
MY_COLLECTION.key = "myCoolKey";
10321035
MY_COLLECTION.persist(); // Success
@@ -1036,19 +1039,20 @@ For persisting a Collection we have two options to provide the required `storage
10361039
MY_COLLECTION.persist("myCoolKey"); // Success
10371040
```
10381041

1039-
If AgileTs couldn't find any key to use as `storage key`,
1040-
it drops an error and doesn't persist the Collection value.
1042+
If AgileTs couldn't find any key that could be used as a `storage key`,
1043+
it throws an error and doesn't persist the Collection value.
10411044
```ts {2}
10421045
MY_COLLECTION.key = undefined;
10431046
MY_COLLECTION.persist(); // Error
10441047
```
10451048

10461049
### 📝 Multiple Storages
1047-
In case our application uses more than one registered Storage,
1048-
we can define with the help of `storageKeys` in which Storage the Collection data should be stored.
1050+
Sometimes it may happen that we store Collections in different Storages.
1051+
For example, Collection A should be stored in Storage B and Collection B should be stored in Storage A.
1052+
Therefore, we can use `storageKeys` to define in which specific Storage the Collection value should be persisted.
10491053
```ts {2}
10501054
MY_COLLECTION.persist({
1051-
storageKeys: ["myCustomStorage"]
1055+
storageKeys: ["myCustomStorage"]
10521056
})
10531057
```
10541058
By `default`, it will be stored in the `default` Storage.
@@ -1294,6 +1298,7 @@ Array<number | string>
12941298
```
12951299

12961300

1301+
12971302
<br />
12981303

12991304
---
@@ -1307,8 +1312,8 @@ Array<number | string>
13071312
With `remove()` we are able to remove Item/s from
13081313

13091314
- ### `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.
1315+
Removes the Item/s at `itemKey/s` from the entire Collection and all [Groups](./group/Introduction.md) / [Selectors](./selector/Introduction.md),
1316+
i.e. from everywhere.
13121317
```ts
13131318
MY_COLLECTION.remove('item1').everywhere();
13141319
```
@@ -1321,8 +1326,8 @@ With `remove()` we are able to remove Item/s from
13211326

13221327
:::info
13231328

1324-
Be aware that a standalone `remove()` doesn't do anything,
1325-
so we always have to add `.everywhere()` or `.fromGroups()`.
1329+
Note that a standalone `remove()` doesn't do anything,
1330+
so we have to always add `.everywhere()` or `.fromGroups()`.
13261331

13271332
:::
13281333

@@ -1336,8 +1341,43 @@ so we always have to add `.everywhere()` or `.fromGroups()`.
13361341

13371342
```ts
13381343
{
1339-
fromGroups: (groups: Array<ItemKey> | ItemKey) => this;
1340-
everywhere: () => this;
1344+
fromGroups: (groups: Array<ItemKey> | ItemKey) => Collection<DataType>;
1345+
everywhere: () => Collection<DataType>;
13411346
}
13421347
```
13431348

1349+
1350+
1351+
<br />
1352+
1353+
---
1354+
1355+
<br />
1356+
1357+
1358+
1359+
## `removeFromGroups()`
1360+
1361+
Removes Item at `itemKey` from specific [Group](./group/Introduction.md).
1362+
```ts
1363+
MY_COLLECTION.removeFromGroups('item1', 'group1');
1364+
```
1365+
It is also possible to remove multiple Items from multiple Groups at once.
1366+
```ts
1367+
MY_COLLECTION.removeFromGroups(['item1', 'item2'], ['group1', 'group5']);
1368+
```
1369+
In the above example the Items at `item1` and `item2` will be removed from the Groups at `group1` and `group5`.
1370+
1371+
### 📭 Props
1372+
1373+
| Prop | Type | Default | Description | Required |
1374+
|----------------------|-----------------------------------------------------------------------------------|------------|-----------------------------------------------------------------------------------------------|----------|
1375+
| `itemKeys` | number \| string | Array<number \| string\> | undefined | itemKey/s that get removed | Yes |
1376+
1377+
### 📄 Return
1378+
1379+
```ts
1380+
Collection
1381+
```
1382+
Returns the [Collection](./Introduction.md) it was called on.
1383+

0 commit comments

Comments
 (0)