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

Commit d3fce1f

Browse files
committed
fixed interval
1 parent b40fbba commit d3fce1f

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

docs/quick_start/React.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ To get a better understanding of how to use a State, we should just try it out.
103103
Therefore, we have created a Live Example, where we can see a [State](../packages/core/features/state/Introduction.md) in action.
104104
The sample project we'll look at is a small counter that lets us increase a number as we click the 'Update State' button.
105105
It may not be very exciting, but it shows all the essential pieces of a React + AgileTs application in action.
106-
After we have tried the live example a bit, we recommend giving the [Important Code Snippets](#-important-code-snippets-e1) a look
106+
After we have tried the live example a bit, we recommend giving the [Important Code Snippets](#-important-code-snippets-e1) below a look
107107
to better understand what the different parts exactly do.
108108
In case you have any further questions, don't mind joining our [Community Discord](https://discord.gg/T9GzreAwPH).
109109
```tsx live
@@ -194,14 +194,15 @@ Each data we collect **needs a unique primary key** like an `id`, to be properly
194194
TODOS.collect({id: "id2", todo: "Try AgileTs"});
195195
```
196196
In the above code snippet, 'id2' at the primary key property `id` is the unique primary key.
197-
The collected data will be automatically transformed into an extension of the State Class called Item, which has the collected data as `value`,
198-
so in our case '{id: "id2", todo: "Try AgileTs"}'.
197+
Every collected data will be automatically transformed into an extension of the State Class called `Item`.
198+
Such an Item has the collected data as `value`, so in the above example that would be '{id: "id2", todo: "Try AgileTs"}'.
199199
A so-called Item has the same functionalities as normal States.
200200
```ts
201201
MY_COLLECTION.getItem('id2').patch({todo: "Clean Bathroom"});
202202
```
203-
Besides Items, a Collection consists primarily of Groups, which allows us to split the Collection into multiple individual sections without
204-
losing redundant behavior. By default, each Item will be added to the `default` Group, representing the default Collection pattern.
203+
Besides Items, a Collection consists primarily of Groups.
204+
A Group allows us to split a Collection into multiple individual sections without
205+
losing any redundant behavior. By default, each Item will be added to the `default` Group, representing the default Collection pattern.
205206
Keep in mind, that a Group doesn't store the Item itself. It only holds an array of `primaryKeys` like a keymap of the data it represents.
206207
```ts
207208
const USER_TODOS = TODOS.createGroup("user-todos", ["id1", "id2"]); // TODOS of a specifc User
@@ -211,7 +212,8 @@ const TODAY_TODOS = TODOS.createGroup("today-todos", ["id3", "id2", "id5"]); //
211212
### 🔴 Live Example [e2]
212213

213214
In this Live Example, we can see a simple [Collection](../packages/core/features/collection/Introduction.md) in action.
214-
The sample project we'll look at is a small todo list that lets us create todos with the help of text input and remove them with a button below each todo item.
215+
The sample project we'll look at is a small todo list that lets us create todos with the help of text input
216+
and remove them with a button below each todo item.
215217
In case you have any further questions, don't mind joining our [Community Discord](https://discord.gg/T9GzreAwPH).
216218
```tsx live
217219
// Let's start by creating our Agile Instance
@@ -275,14 +277,15 @@ const MY_FIRST_COLLECTION = App.createCollection({
275277
To create our first Collection, we need the previously instantiated Instance of AgileTs.
276278
Then we can bring our first Collection to life,
277279
which got the initial Item `{id: 1, name: "Clean Bathroom"}`.
278-
Besides the creation, we store the Collection in the `localStorage` with the help of the `persist()` function.
280+
Besides the creation, we store the Collection permanently in the `localStorage` with the help of the `persist()` function.
281+
So if you refresh the page your modifications to the todo list shouldn't be lost.
279282

280283
```ts
281284
const myFirstCollection = useAgile(MY_FIRST_COLLECTION);
282285
```
283286
Here we use the [`useAgile`](../packages/react/features/Hooks.md#useagile) React Hook
284287
to bind our Collection to the React Component.
285-
In the case of a Collection, it returns the `default` Group `value` in array shape.
288+
When passing a Collection, `useAgile` returns the `default` Group `value` in array shape.
286289
In our case, something like:
287290
```ts
288291
[
@@ -295,14 +298,15 @@ In our case, something like:
295298
MY_FIRST_COLLECTION.collect({id: generateId(), name: currentInput});
296299
```
297300
In order to add new Data to the Collection, we can use the `collect()` function.
298-
We simply add the _currentInput_ with a random `id` as primaryKey.
301+
In the example we simply add the _currentInput_ with a random `id` as primaryKey to the Collection.
299302

300303
```ts
301304
TODOS.remove(value.id).everywhere();
302305
```
303306
In case we have done a todo, of course, we want to remove it.
304307
The `remove()` function helps us to reach this goal.
305-
The `everywhere()` tag means that the Item will be removed from the whole Collection.
308+
The `everywhere()` tag means that the Item will be removed from the whole Collection
309+
and not just from a Group.
306310

307311
## 🔍 Next Steps
308312

docusaurus.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const customFields = {
3333
`⏰ If you want to stay update to date, follow use on <a target="_blank" rel="noopener noreferrer" href="https://twitter.com/AgileFramework">Twitter</a>`,
3434
],
3535
random: false,
36-
interval: 100000,
36+
interval: 1000,
3737
},
3838
liveCodeScope: {
3939
Agile,

0 commit comments

Comments
 (0)