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

Commit 5a5d56c

Browse files
authored
Merge pull request #81 from agile-ts/develop
added dynamic announcementBar
2 parents ee2e97e + 5296ad1 commit 5a5d56c

39 files changed

+1643
-312
lines changed

docs/Interfaces.md

Lines changed: 84 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -172,68 +172,6 @@ For example Agile Logs are by default purple.
172172

173173

174174

175-
## `StorageMethods`
176-
177-
The `StorageMethodsInterface` is used in the creation of a Agile [Storage](./packages/core/features/storage/Introduction.md) Interface.
178-
Here is a Typescript Interface for quick reference,
179-
however each property will be explained in more detail below.
180-
```ts
181-
export interface StorageMethodsInterface {
182-
get: (key: string) => any;
183-
set: (key: string, value: any) => void;
184-
remove: (key: string) => void;
185-
}
186-
```
187-
188-
<br/>
189-
190-
#### `get`
191-
192-
Method to get a specific value at `primaryKey` from the external Storage.
193-
```ts
194-
myStorage.get("item1"); // Calls the here defined get method
195-
```
196-
197-
| Type | Default | Required |
198-
|--------------------------|-----------|----------|
199-
| `(key: string) => any` | undefined | Yes |
200-
201-
<br/>
202-
203-
#### `set`
204-
205-
Method to set a specific value at `primaryKey` into the external Storage.
206-
```ts
207-
myStorage.set("item1", {my: "value"}); // Calls the here defined set method
208-
```
209-
210-
| Type | Default | Required |
211-
|---------------------------------------|-----------|----------|
212-
| `(key: string, value: any) => void` | undefined | Yes |
213-
214-
<br/>
215-
216-
#### `remove`
217-
218-
Method to remove a specific value at `primaryKey` from the external Storage.
219-
```ts
220-
myStorage.remove("item1"); // Calls the here defined remove method
221-
```
222-
223-
| Type | Default | Required |
224-
|----------------------------|-----------|----------|
225-
| `(key: string) => void` | undefined | Yes |
226-
227-
228-
229-
<br/>
230-
231-
---
232-
233-
<br/>
234-
235-
236-
237175
## `StateIngestConfig`
238176

239177
The `StateIngestConfigInterface` is used as configuration object in functions like `set()` or `undo()`.
@@ -247,7 +185,7 @@ export interface StateIngestConfigInterface
247185
}
248186
```
249187
The `StateIngestConfigInterface` extends some other Interfaces:
250-
- [StateRuntimeJobConfigInterface](#stateruntimejobconfiginterface)
188+
- [StateRuntimeJobConfigInterface](#stateruntimejobconfig)
251189
- [IngestConfigInterface](#ingestconfiginterface)
252190

253191
<br/>
@@ -280,7 +218,7 @@ to see when which change has been passed through the `runtime`.
280218

281219

282220

283-
## `StateRuntimeJobConfigInterface`
221+
## `StateRuntimeJobConfig`
284222

285223
The `StateRuntimeJobConfigInterface` is used as configuration object in functions like `replace()` or `select()`.
286224
Here is a Typescript Interface for quick reference,
@@ -935,12 +873,14 @@ The `GroupAddConfigInterface` is used as configuration object in functions like
935873
Here is a Typescript Interface for quick reference,
936874
however each property will be explained in more detail below.
937875
```ts
938-
export interface GroupAddConfig {
876+
export interface GroupAddConfig extends StateIngestConfigInterface {
939877
method?: 'unshift' | 'push';
940878
overwrite?: boolean;
941-
background?: boolean;
942879
}
943880
```
881+
The `GroupAddConfig` extends some other Interfaces:
882+
- [StateIngestConfigInterface](#stateingestconfig)
883+
944884

945885
<br/>
946886

@@ -982,24 +922,6 @@ MY_GROUP.add(5); // Group value is '[1, 5, 6, 2]'
982922
|--------------------------|-----------|----------|
983923
| `boolean` | false | No |
984924

985-
<br/>
986-
987-
#### `background`
988-
989-
If the `itemKey` should be added in `background`,
990-
so that no Component rerender which has bound the Group to itself.
991-
```ts {5}
992-
// Causes rerender on Components
993-
MY_GROUP.add(1);
994-
995-
// Doesn't cause rerender on Components
996-
MY_GROUP.add(1, {background: true});
997-
```
998-
999-
| Type | Default | Required |
1000-
|--------------------------|-----------|----------|
1001-
| `boolean` | false | No |
1002-
1003925

1004926

1005927
<br/>
@@ -1049,31 +971,96 @@ MY_COLLECTION.updateItemKey([1, 3], {background: true});
1049971

1050972

1051973

1052-
## `GroupRemoveConfig`
974+
## `ComputeConfig`
1053975

1054-
The `GroupRemoveConfigInterface` is used as configuration object in functions like `remove()`.
976+
The `RecomputeConfigInterface` is used as configuration object in functions like `compute()`.
1055977
Here is a Typescript Interface for quick reference,
1056978
however each property will be explained in more detail below.
1057979
```ts
1058-
export interface GroupRemoveConfigInterface {
1059-
background?: boolean;
980+
export interface ComputeConfigInterface {
981+
autodetect?: boolean;
1060982
}
1061983
```
1062984

1063985
<br/>
1064986

1065-
#### `background`
987+
#### `autodetect`
1066988

1067-
If the `itemKey` should be removed in `background`,
1068-
so that no Component rerender which has bound the Group to itself.
1069-
```ts {5}
1070-
// Causes rerender on Components
1071-
MY_GROUP.remove(1);
989+
If the Computed should autodetect dependencies used in the `computeFunction`.
990+
```ts {2,4}
991+
MY_COMPUTED.computeFunction = () => MY_NAME.value + MY_AGE.value;
992+
MY_COMPUTED.recompute({autodetect: false});
993+
MY_COMPUTED.deps; // Returns '[]'
994+
MY_COMPUTED.recompute({autodetect: true});
995+
MY_COMPUTED.deps; // Returns '[Obserrver(MY_NAME), Observer(MY_AGE)]'
996+
```
1072997

1073-
// Doesn't cause rerender on Components
1074-
MY_GROUP.remove(1, {background: true});
998+
| Type | Default | Required |
999+
|--------------------------|-----------|----------|
1000+
| `boolean` | true | No |
1001+
1002+
1003+
1004+
<br/>
1005+
1006+
---
1007+
1008+
<br/>
1009+
1010+
1011+
1012+
## `RecomputeConfig`
1013+
1014+
The `RecomputeConfigInterface` is used as configuration object in functions like `recompute()`.
1015+
Here is a Typescript Interface for quick reference,
1016+
however each property will be explained in more detail below.
1017+
```ts
1018+
export interface RecomputeConfigInterface
1019+
extends StateIngestConfigInterface,
1020+
ComputeConfigInterface {}
1021+
```
1022+
The `RecomputeConfig` extends some other Interfaces:
1023+
- [StateIngestConfigInterface](#stateingestconfig)
1024+
- [ComputeConfigInterface](#computeconfig)
1025+
1026+
1027+
1028+
<br/>
1029+
1030+
---
1031+
1032+
<br/>
1033+
1034+
1035+
1036+
## `UpdateComputeFunctionConfig`
1037+
1038+
The `UpdateComputeFunctionConfigInterface` is used as configuration object in functions like `updateComputeFunction()`.
1039+
Here is a Typescript Interface for quick reference,
1040+
however each property will be explained in more detail below.
1041+
```ts
1042+
export interface UpdateComputeFunctionConfigInterface
1043+
extends RecomputeConfigInterface {
1044+
overwriteDeps?: boolean;
1045+
}
1046+
```
1047+
The `RecomputeConfig` extends some other Interfaces:
1048+
- [RecomputeConfigInterface](#recomputeconfig)
1049+
1050+
<br/>
1051+
1052+
#### `overwriteDeps`
1053+
1054+
If the new hard coded dependencies should entirely overwrite the old hard coded dependencies or get merged into them.
1055+
```ts {2,4}
1056+
MY_COMPUTED.deps; // // Returns '[Obserrver(MY_NAME), Observer(MY_AGE)]'
1057+
MY_COMPUTED.updateComputeFunction(() => {}, [MY_LOCATION], {overwriteDeps: false});
1058+
MY_COMPUTED.deps; // // Returns '[Obserrver(MY_NAME), Observer(MY_AGE), Observer(MY_LOCATION)]'
1059+
MY_COMPUTED.updateComputeFunction(() => {}, [MY_LOCATION], {overwriteDeps: true});
1060+
MY_COMPUTED.deps; // // Returns '[Observer(MY_LOCATION)]'
10751061
```
10761062

10771063
| Type | Default | Required |
10781064
|--------------------------|-----------|----------|
1079-
| `boolean` | false | No |
1065+
| `boolean` | true | No |
1066+

docs/examples/react-native/All.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ slug: /examples/react-native
99

1010
WIP Docs!
1111

12-
:::
12+
:::
13+
14+
https://snack.expo.io/@bennodev/agilets-first-state

docs/examples/react/All.mdx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,21 @@ export const CodeSandBoxEmbed = ({ uri, height }) => (
2626
);
2727

2828
## 😎 First State
29-
3029
<CodeSandBoxEmbed uri={"agilets-first-state-f12cz"}/>
3130

32-
## 👨‍👩‍👦‍ First Collection
3331

32+
## 👨‍👩‍👦‍ First Collection
3433
<CodeSandBoxEmbed uri={"agilets-first-collection-uyi9g"} />
3534

3635

36+
## ⚙️‍ First Computed
37+
<CodeSandBoxEmbed uri={"agilets-first-computed-kisgr"} />
38+
39+
3740
## 📝 Multieditor
41+
<CodeSandBoxEmbed uri={"multieditor-yxt4x"} height={800}/>
42+
43+
44+
## 👴 First State [Class Component]
45+
<CodeSandBoxEmbed uri={"agilets-first-state-with-hoc-1qdew"}/>
3846

39-
<CodeSandBoxEmbed uri={"multieditor-yxt4x"} height={800}/>

docs/main/Frameworks.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
id: frameworks
3+
title: Frameworks
4+
sidebar_label: Frameworks
5+
slug: /frameworks
6+
---
7+
8+
### 👾 UI-Layers
9+
10+
| Framework | Supported | Planned |
11+
|----------------------------------|-----------|---------|
12+
| [React](https://reactjs.org) | true | - |
13+
| [Angular](https://angular.io/) | false | true |
14+
| [Vue](https://vuejs.org/) | false | true |
15+
| [Svelte](https://svelte.dev/) | false | false |
16+
17+
### 🤖 SSR-Frameworks
18+
19+
| Framework | Supported | Planned |
20+
|-------------------------------------|-----------|---------|
21+
| [NextJS](https://nextjs.org/) | false | true |
22+
| [Gatsby](https://www.gatsbyjs.com/) | false | true |
23+
24+
### ❓ Something missing
25+
26+
If you find issues with the documentation or have suggestions on how to improve the documentation or the project in
27+
general, please [file an issue](https://github.com/agile/agile-ts/issues) for us or join
28+
our [Discord Community](https://discord.gg/T9GzreAwPH).

docs/main/Installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar_label: Installation
55
slug: /installation
66
---
77

8-
AgileTs is essentially a set of npm [packages](https://github.com/agile-ts/agile/tree/master/packages) that can be installed over [npm](https://www.npmjs.com/).
8+
`AgileTs` is essentially a set of node modules [packages](https://github.com/agile-ts/agile/tree/master/packages) that can be installed over [npm](https://www.npmjs.com/).
99

1010
### 🔑 Requirements
1111

docs/main/Introduction.md

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ Write minimalistic, boilerplate-free code that captures your intent.
3939

4040
**Some straightforward syntax examples:**
4141

42+
- Mutate and Check States with simple Functions
43+
```ts
44+
MY_STATE.undo(); // Undo latest change
45+
MY_STATE.is({hello: "jeff"}); // Check if State has the Value '{hello: "jeff"}'
46+
```
4247
- Store State in any Storage, like [Local Storage](https://www.w3schools.com/html/html5_webstorage.asp)
4348
```ts
4449
MY_STATE.persist("storage-key")
@@ -49,28 +54,28 @@ Write minimalistic, boilerplate-free code that captures your intent.
4954
MY_COLLECTION.collect({id: 1, name: "Frank"});
5055
MY_COLLECTION.collect({id: 2, name: "Dieter"});
5156
```
52-
- Mutate and Check States with simple Functions
53-
```ts
54-
MY_STATE.undo(); // Undo latest change
55-
MY_STATE.is({hello: "jeff"}); // Check if State has the Value '{hello: "jeff"}'
56-
```
5757

5858
### 🤸‍ Flexible
5959

60-
- Works in nearly any UI-Framework. Check [here](https://agile-ts.org/docs/frameworks) if your preferred Framework is supported too.
60+
- Works in nearly any UI-Layer. Check [here](Frameworks.md) if your preferred Framework is supported too.
6161
- Surly behaves with the workflow which suits you best. No need for _reducers_, _actions_, ..
62-
- Has **no** external dependencies
62+
- Has **0** external dependencies
63+
64+
### ⛳️ Centralize
65+
66+
AgileTs is designed to take all business logic out of UI-Components and put them in a central place often called `core`.
67+
The benefit of keeping logic separate to UI-Components is to make your code more decoupled, portable and above all easily testable.
6368

6469
### 🎯 Easy to Use
6570

6671
Learn the powerful tools of AgileTs in a short amount of time. An excellent place to start are
67-
our [Quick Start](./Installation.md) Guides, or if you are no fan of following any tutorial, check out
68-
the [Example](../examples) section.
72+
our [Quick Start](./Installation.md) Guides, or if you are no fan of following any tutorial,
73+
jump straight into our [Example](../examples) section.
6974

7075

7176
## ⏳ Quick Example
7277

73-
Instead of talking too much about the advantages of AgileTs, we should start coding.
78+
Instead of talking too much about the benefits of AgileTs, let's start programming.
7479

7580
### 😎 Our first State
7681

@@ -98,11 +103,17 @@ To find out more, check out our [Quick Start Guides](./Installation.md).
98103
Test AgileTs yourself. It's only one click away. Just select your preferred Framework below.
99104

100105
- [React](https://codesandbox.io/s/agilets-first-state-f12cz)
106+
- [React-Native](https://snack.expo.io/@bennodev/agilets-first-state)
101107
- Vue (coming soon)
102108
- Angular (coming soon)
103109

104110
More examples can be found in the [Example](../examples/Indroduction.md) Section.
105111

112+
## 👨‍💻 When use AgileTs
113+
114+
AgileTs is thought to handle the business logic and logic in general that isn't explicitly bound to a Component of your application.
115+
So you should use AgileTs if you have to handle any global State and logic that you want to manage at a central place.
116+
106117
## 👨‍🏫 Learn AgileTs
107118

108119
We have a variety of resources available to help you learn AgileTs. An excellent place to start are
@@ -132,6 +143,8 @@ the [api](../packages/api/Introduction.md) package. If you click on one of them,
132143
about the package, an Installation Guide and all its features. In case of the [core](../packages/core/Introduction.md)
133144
package you find the [State](../packages/core/features/state/Introduction.md)
134145
and [Collection](../packages/core/features/collection/Introduction.md) docs in the Features Section.
146+
Be aware that `⚠️ WIP` isn't an actual package. It is meant to separate packages that are currently `work in progress`
147+
and not ready for the outer world.
135148

136149
### 📁 Examples
137150

0 commit comments

Comments
 (0)