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

Commit d94516c

Browse files
authored
Merge pull request #71 from agile-ts/develop
Develop
2 parents 228bd03 + 82a335d commit d94516c

File tree

13 files changed

+165
-99
lines changed

13 files changed

+165
-99
lines changed

docs/main/Installation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ AgileTs is essentially a set of npm [packages](https://github.com/agile-ts/agile
1414
### 🚀 Quick Start
1515

1616
To make your start as easy as possible, we have created some quick guides. You can follow these to get AgileTs up and
17-
running in your environment without wasting any time. Below you can find environments AgileTs is already supporting.
17+
running in your environment without wasting any time. Below you find _Quick Starts_ for already supported frameworks.
1818

1919
- [React](../quick_start/React.md)
2020
- Vue (coming soon)
2121
- Angular (coming soon)
2222

2323
### 🗂 Packages
2424

25-
Here are some separate installation guides for single AgileTs packages.
25+
Separate installation guides for single AgileTs packages.
2626

2727
- [Core](../packages/core/Installation.md)
2828
- [React](../packages/react/Installation.md)

docs/main/Introduction.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar_label: Introduction
55
slug: /introduction/
66
---
77

8-
> **Spacy, Simple, Scalable State Management Framework**
8+
> **Global, Spacy, Scalable State and Logic Framework**
99
1010
<a href="https://github.com/agile-ts/agile">
1111
<img src="https://img.shields.io/github/license/agile-ts/agile.svg?label=license&style=flat&colorA=293140&colorB=4a4872" alt="GitHub License"/></a>
@@ -30,8 +30,8 @@ and not completed yet!
3030

3131
## 👋 Introduction
3232

33-
AgileTs is a simple, fast, and well-tested State Management Framework implemented in TypeScript. It's more
34-
flexible and boilerplate-free than Redux and has an interesting approach to reducing the codebase size through a
33+
AgileTs is a global, simple, well-tested State Management Framework implemented in TypeScript.
34+
It's more flexible and boilerplate-free than frameworks like Redux and has a powerful approach to reducing the codebase size through a
3535
centralized memory design pattern. The philosophy behind AgileTs is simple:
3636

3737
### 🚅 Straightforward
@@ -49,15 +49,15 @@ Write minimalistic, boilerplate-free code that captures your intent.
4949
MY_COLLECTION.collect({id: 1, name: "Frank"});
5050
MY_COLLECTION.collect({id: 2, name: "Dieter"});
5151
```
52-
- Mutate or Check States with simple Functions
52+
- Mutate and Check States with simple Functions
5353
```ts
5454
MY_STATE.undo(); // Undo latest change
5555
MY_STATE.is({hello: "jeff"}); // Check if State has the Value '{hello: "jeff"}'
5656
```
5757

5858
### 🤸‍ Flexible
5959

60-
- Works in nearly every UI-Framework. Check [here](https://agile-ts.org/docs/frameworks) if your preferred Framework is supported too.
60+
- Works in nearly any UI-Framework. Check [here](https://agile-ts.org/docs/frameworks) if your preferred Framework is supported too.
6161
- Surly behaves with the workflow which suits you best. No need for _reducers_, _actions_, ..
6262
- Has **no** external dependencies
6363

@@ -110,8 +110,7 @@ our [Quick Start](./Installation.md) Guides, where you learn the basics about ho
110110
Framework. After knowing the ground concept of AgileTs, we recommend checking out the [Style Guides](./StyleGuide.md).
111111
The Style Guides will help you get some inspiration on structuring a scalable application using AgileTs. Now you
112112
are ready to use AgileTs wherever you want. In case you need some more information about some functionalities of AgileTs,
113-
use the search bar in the top right corner. If you have any questions and can't find the correct answer in the
114-
documentation, don't hesitate to join our [Discord Community](https://discord.gg/T9GzreAwPH).
113+
use the search bar in the top right corner. In case you have any further questions don't hesitate to join our [Community Discord](https://discord.gg/T9GzreAwPH).
115114

116115
## 🏢 Structure of Documentation
117116

docs/packages/core/Introduction.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,24 @@ slug: /core
2121

2222
## `core`
2323

24-
The `core` package is the brain of AgileTs. Nearly everything related to AgileTs depends on this package. It
25-
includes the main Instance of AgileTs, the [`Agile Class`](./features/agile-instance/Introduction.md) often
26-
called `App`.
24+
The `core` is the main package of AgileTs and includes the whole state management logic.
25+
Therefore, it can be seen as the brain of AgileTs that manages all your States.
26+
It includes the main Instance of AgileTs, called [`Agile Class`](./features/agile-instance/Introduction.md).
2727
```ts
2828
const App = new Agile();
2929
```
30-
In summary, the main tasks of the `Agile Class` are to
31-
- manage Agile Sub Instances, like [States](./features/state/Introduction.md), ..
32-
- ingest changes into the Runtime
30+
In summary, the most important tasks of the `Agile Class` are to
31+
- manage `Agile Sub Instances`, like [States](./features/state/Introduction.md), ..
32+
- ingest changes into the `runtime`
3333
- trigger rerender in Integrations like [React](../react/Introduction.md)
3434
- store values in any [Storage](./features/storage/Introduction.md)
3535

36-
As you can guess, each application using AgileTs has to install
37-
the `core` package and instantiate such an `Agile Class`.
38-
To get some inspiration where to instantiate such`Agile Class`, check out the [Style Guide](../../main/StyleGuide.md).
39-
Besides the `Agile Class` the `core` holds some other useful classes
40-
listed below. But each of these classes depends in some kind on the `Agile Class`.
36+
Each application using AgileTs needs the `core` package
37+
and has to instantiate a `Agile Class` often called `App`.
38+
To get some inspiration where to instantiate the `Agile Class`, check out the [Style Guide](../../main/StyleGuide.md) Section.
39+
Besides the `Agile Class` the `core` holds some other useful classes,
40+
which represent the actual features of AgileTs, since the `Agile Class`
41+
is mostly used internally.
4142

4243
### ⚡️ [State](./features/state/Introduction.md)
4344
A State holds an Information that we need to remember at a later point in time.
@@ -57,7 +58,8 @@ MY_COLLECTION.remove(1).everywhere(); // Remove Data at primary Key '1' from Col
5758
```
5859

5960
### 🤖 [Computed](./features/state/Introduction.md)
60-
A Computed is an extension of the `State Class`, it does automatically compute its value depending on other Agile Instances like States, Collections, ..
61+
A Computed is an extension of the `State Class`,
62+
it automatically computes its value depending on other Agile Sub Instances like States, Collections, ..
6163
```ts
6264
const MY_COMPUTED = App.createComputed(() => (MY_STATE_1.value + MY_STATE_2.value));
6365
```

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ The `Agile Class` is the foundation of AgileTs. Everything related to AgileTs de
1515
```ts
1616
const App = new Agile();
1717
```
18-
It can be seen as your application store, which manages and stores each `Agile Sub Instance` (ASI).
19-
The `Agile Class` doesn't contain these ASI's internally, but each ASI includes a reference to the main `Agile Class`. For instance, to pass something into the `runtime`.
18+
It can be seen as your application store, which manages each `Agile Sub Instance` (ASI).
19+
The `Agile Class` doesn't contain these ASI's internally, but each ASI includes a reference to the main `Agile Class`.
20+
For instance, to pass something into the `runtime`.
2021
Here are some Agile Sub Instances (ASI):
2122

2223
- [State](../state/Introduction.md)
@@ -43,7 +44,8 @@ In summary, the main tasks of an instantiated `Agile Class` (Agile Instance) are
4344
- trigger rerender on Integrations like [React](../../../react/Introduction.md)
4445
- store values in any [Storage](../storage/Introduction.md)
4546

46-
Be aware that each application using AgileTs should have **one** `Agile Instance` because multiple can cause trouble.
47+
Be aware that each application using AgileTs needs at least one `Agile Instance`,
48+
but also shouldn't have more, because multiple `Agile Instance` in one application might cause trouble.
4749

4850
## 📭 Props
4951

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

Lines changed: 38 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ WIP docs!
1111

1212
:::
1313

14-
A Collection holds a set of Information we need to remember at a later point in time.
14+
A Collection holds a _set_ of Information we need to remember at a later point in time.
1515
It is designed for arrays of data objects following the same pattern.
1616
Each of these objects must have a **unique primaryKey** to be correctly identified later.
1717
We instantiate a Collection with help of an existing [Agile Instance](../agile-instance/Introduction.md) often called `App`.
@@ -26,7 +26,7 @@ MY_COLLECTION.collect({id: 1, name: "jeff"}); // Add Item to Collection
2626
MY_COLLECTION.remove(1).everywhere(); // Remove Item from Collection
2727
MY_COLLECTION.persist(); // Persists Collection Value into a Storage
2828
```
29-
If you want to find out more about the Collection's specific methods, check out the [Methods](./Methods.md) docs.
29+
If you want to find out more about the Collection's specific methods, check out the [Methods](./Methods.md) Section.
3030
Most methods we use to modify, mutate and access the Collection are chainable.
3131
```ts
3232
MY_COLLECTION.collect({id: 1, name: "jeff"}).persist().removeGroup('myGroup').reset();
@@ -46,7 +46,7 @@ In the example above, we create a simple `TODO` Collection.
4646
After the instantiation, we add two todos to it
4747
and specify that both todos remain to the `user1` [Group](#groups).
4848
We do that to keep track of which todo relates to which user.
49-
Now that we cleaned our bathroom,
49+
Now that we `cleaned our bathroom`,
5050
we remove the todo related to the id `1` from the Collection and all Groups (everywhere).
5151

5252
### ⛳️ Sandbox
@@ -55,19 +55,23 @@ Test the Collection yourself. It's only one click away. Just select your preferr
5555
- Vue (coming soon)
5656
- Angular (coming soon)
5757

58-
## 🔹 Item
58+
## 🗂 Collection Classes
59+
60+
A Collection consists of several classes, all of which perform important tasks.
61+
62+
### 🔹 Item
5963

6064
Each Data Object we add to our Collection (for example, with the `collect()` method)
61-
automatically becomes an `Item` and gets stored in a so-called `data` object directly in the Collection.
65+
automatically becomes an `Item` and gets directly stored in a so-called `data` object in the Collection.
6266
```ts
6367
{
64-
99: Item() // has value '{id: 99, name: "frank"}'
65-
1: Item() // has value '{id: 1, name: "jeff"}'
66-
2: Item() // has value '{id: 2, name: "hans"}'
68+
99: Item(99) // has value '{id: 99, name: "frank"}'
69+
1: Item(1) // has value '{id: 1, name: "jeff"}'
70+
2: Item(2) // has value '{id: 2, name: "hans"}'
6771
}
6872
```
6973
It is best not to touch the `data` object at all
70-
and use the provided functions by the Collection to mutate and get access to it instead.
74+
and use the functions provided by the Collection to mutate and get access to it instead.
7175
For instance, there are many ways to access our collected Items.
7276

7377
- #### `getItem()`
@@ -104,7 +108,7 @@ myItem.patch({name: "frank"}); // Update property 'name' in Item
104108
myItem.undo(); // Undo latest change
105109
```
106110

107-
## 👨‍👧‍👦 [Group](./group/Introduction.md)
111+
### 👨‍👧‍👦 [Group](./group/Introduction.md)
108112

109113
Often applications need to categorize and preserve the ordering of structured data.
110114
In AgileTs, Groups are the cleanest way to do so.
@@ -138,7 +142,7 @@ POSTS.collect(user.posts, user.id);
138142
In the above code snippet, we have two Collections, one for users and another for posts.
139143
We can collect posts specific to a user and group them automatically by the user's id.
140144

141-
## 🔮 [Selector](./selector/Introduction.md)
145+
### 🔮 [Selector](./selector/Introduction.md)
142146

143147
Sometimes we need access to one specific Item of a Collection in the long term.
144148
Therefore, AgileTs offers the Selector.
@@ -164,19 +168,23 @@ App.createCollection(config);
164168

165169
### `config`
166170

167-
A `Collection` takes an optional configuration object as its only property.
171+
A `Collection` takes an optional configuration object as its only parameter.
168172
There are two different ways of configuring a Collection. Both have their advantages.
169173

170174
- **1.** The plain _object_ way, which is notorious for its ease of use.
171-
Because here, we configure everything in a specific object. For instance, this makes the creation of Groups pretty straightforward. But on the other hand, it gives us some limitations since we aren't creating and configuring the Groups and Selectors on our own. The Collection takes care of it instead.
175+
Here, we configure everything in a specific object. For instance, this makes the creation of Groups pretty straightforward.
176+
But on the other hand, it gives us some limitations since we aren't creating and configuring the Groups and Selectors on our own.
177+
The Collection takes care of it instead.
172178
```ts
173179
const Collection = App.createCollection({
174180
key: 'dummyCollection',
175181
group: ["dummyGroup"]
176182
})
177183
```
178184

179-
- **2.** The _function_ way, where a function, which has the Collection as first parameter, returns the configuration object. This gives us more freedom in configuring Instances like Groups, since we have access to the Collection and can create them on our own.
185+
- **2.** The _function_ way, where a function, which has the Collection as first parameter, returns the configuration object.
186+
This gives us more freedom in configuring Instances like Groups,
187+
since we have access to the Collection and can create them on our own.
180188
```ts
181189
const Collection = App.createCollection((collection) => ({
182190
key: 'dummyCollection',
@@ -203,15 +211,15 @@ export interface CreateCollectionConfigInterface<DataType = DefaultItem> {
203211

204212
#### `groups`
205213
The initial [Groups](#groups) of our Collection are defined with this property's help.
206-
There are two ways of doing this.
207-
The first one is to pass an Array of Group Names.
208-
AgileTs will than take care of the Group's creation and calls them after the previously passed names.
214+
There are two different ways of doing so.
215+
The first one is to pass an Array of Group names/keys,
216+
where AgileTs takes care of the Group's creation and names them after the previously passed names.
209217
```ts
210218
const MY_COLLECTION = App.createCollection({
211219
groups: ["myGroup1", "myGroup2"]
212220
});
213221
```
214-
The way mentioned above has some limitations. For instance, we can't define any initial Items.
222+
The way mentioned above has some limitations, since we can't configure the Groups on our own.
215223
Luckily there is a second way, where we have access to the Collection itself.
216224
```ts
217225
const MY_COLLECTION = App.createCollection((collection) => ({
@@ -223,21 +231,21 @@ const MY_COLLECTION = App.createCollection((collection) => ({
223231
}));
224232
```
225233
With the help of the Collection, we can 'instantiate' the Groups on our own,
226-
which gives us much more freedom configuring in configuring them.
234+
which gives us much more freedom in configuring them.
227235

228236
<br/>
229237

230238
#### `selectors`
231239
The initial [Selectors](#selectors) of our Collection are defined with this property's help.
232-
As with the `groups` property, there are two ways of doing that.
233-
The first one is to pass an Array of Selector Names.
234-
AgileTs will than take care of the Selector's creation and calls them after the previously passed names.
240+
As with the `groups` property, there are two different ways of doing so.
241+
The first one is to pass an Array of Selector names/keys,
242+
where AgileTs takes care of the Selector's creation and names them after the previously passed names.
235243
```ts
236244
const MY_COLLECTION = App.createCollection({
237245
selectors: ["mySelector1", "mySelector2"]
238246
});
239247
```
240-
The way mentioned above has some limitations. For instance, we can't define the initial selected Item Key.
248+
The way mentioned above has some limitations, since we can't configure the Selectors on our own.
241249
Luckily there is a second way, where we have access to the Collection which gets created.
242250
```ts
243251
const MY_COLLECTION = App.createCollection((collection) => ({
@@ -257,7 +265,7 @@ which gives us much more freedom in configuring them.
257265
The name/key is an optional property that is used to identify a specific Collection.
258266
Such key is pretty useful during debug sessions or if we persist our Collection,
259267
it automatically uses the Collection `key` as persist key.
260-
We recommend giving each Collection an unique `key`, since it has only advantages.
268+
We recommend giving each Collection a unique `key`, since it has only advantages.
261269
```ts
262270
const MY_COLLECTION = App.createCollection({
263271
key: "myKey"
@@ -267,7 +275,7 @@ const MY_COLLECTION = App.createCollection({
267275
<br/>
268276

269277
#### `primaryKey`
270-
It defines which property's value in collected data will be selected as `primaryKey`.
278+
Defines which property's value in collected data will be selected as `primaryKey`.
271279
By default, it is `id`. A `primaryKey` identifies a specific Item, and has to be part of each collected data.
272280
```ts
273281
const MY_COLLECTION = App.createCollection({
@@ -282,12 +290,12 @@ MY_COLLECTION.collect({key: 1, name: "hans"});
282290
<br/>
283291

284292
#### `defaultGroupKey`
285-
The defaultGroupKey describes the name/key of the default [Group](#group).
293+
Describes the name/key of the default [Group](#group).
286294
The default Group represents all Items of the Collection.
287-
By default, its is `default`.
295+
By default, it is `default`.
288296
```ts
289297
const MY_COLLECTION = App.createCollection({
290-
defaultGroupKey: "allItemsOfCollection"
298+
defaultGroupKey: "allItemsOfCollectionKey"
291299
});
292300
```
293301

@@ -303,7 +311,8 @@ const MY_COLLECTION = App.createCollection({
303311

304312
## 🟦 Typescript
305313

306-
A `Collection` is almost 100% typesafe and takes an optional generic type for type safety that has to be followed by each collected data object.
314+
A `Collection` is almost 100% typesafe and takes an optional generic type for type safety
315+
that has to be followed by each collected data object.
307316
```ts
308317
interface UserInterface {
309318
id: number,

0 commit comments

Comments
 (0)