@@ -11,11 +11,16 @@ WIP docs!
11
11
12
12
:::
13
13
14
- The _ Agile Instance_ is created with ` new Agile() ` and should be unique to our application.
14
+ The ` Agile Class ` is the foundation of AgileTs,
15
+ nearly everything related to AgileTs depends in some kind on it.
15
16
``` ts
16
17
const App = new Agile ();
17
18
```
18
- With an instantiated _ Agile Instance_ , we are able to create any Agile Sub Instances like
19
+ Each created Agile Instance should be unique to our application,
20
+ and we should avoid having multiple from these in one application.
21
+ The Agile Instance can be seen as the store, which offers many powerful features
22
+ to mutate and work with the stored Instances.
23
+ Such Instances can be created with help of the Agile Instance and get automatically stored in it.
19
24
- [ State] ( ../state/Introduction.md )
20
25
``` ts
21
26
const MY_STATE = App .createState (" Hello there" );
@@ -33,10 +38,6 @@ With an instantiated _Agile Instance_, we are able to create any Agile Sub Insta
33
38
const MY_EVENT = App .createEvent ();
34
39
```
35
40
36
- These Sub Instances created with the help of the ` Agile Class ` are automatically bound to it.
37
- Because of the storing behaviour, the ` Agile Class ` can also be seen as a Store,
38
- that offers many features to mutate and work with the stored Instances.
39
-
40
41
## 📭 Props
41
42
42
43
` Agile ` takes an optional configuration object as its only parameter.
@@ -60,9 +61,11 @@ export interface CreateAgileConfigInterface {
60
61
61
62
### ` logConfig `
62
63
63
- The logConfig is thought to configure the Logger of AgileTs.
64
- For instance, we can configure if we want to log all messages or
65
- only warnings. [ Here] ( ../../../../Interfaces.md#createloggerconfig ) you can find all configuration options.
64
+ The ` logConfig ` is thought to configure the Logger of AgileTs.
65
+ The Agile Logger simply logs important events in the console, like warnings or errors,
66
+ but it also logs runtime events if this is desired.
67
+ So for instance here we can configure if we want to log all messages or
68
+ only warnings.
66
69
``` ts
67
70
const App = new Agile ({
68
71
logConfig: {
@@ -71,25 +74,29 @@ const App = new Agile({
71
74
},
72
75
});
73
76
```
77
+ To find out more about possible configuration options, checkout the [ CreateLoggerConfigInterface] ( ../../../../Interfaces.md#createloggerconfig ) .
74
78
75
79
76
80
### ` localStorage `
77
81
78
- Defines whether we want to use the Local Storage as default Storage or not.
79
- If we use the Local Storage each Agile Sub Instance we persist, gets stored in the Local Storage by default.
80
- We aren't limited to the Local Storage, we can configure our own [ Storage] ( ../storage/Introduction.md ) .
81
- This is in a Mobile Environment necessary, because there the Local Storage doesn't exist.
82
- With ` App.registerStorage() ` we can register our wished [ Storage] ( ../storage/Introduction.md ) .
82
+ Defines whether AgileTs creates an interface to the ` localStorage ` for us.
83
+ If we have decided to use the local storage, each Agile Sub Instance we
84
+ persist, gets stored into the ` localStorage ` by default.
83
85
``` ts
84
86
const App = new Agile ({
85
87
localStorage: false // default true
86
88
});
87
89
```
90
+ Of course, we aren't limited to the ` localStorage ` .
91
+ We are able to create an Interface to any [ Storage] ( ../storage/Introduction.md ) we want.
92
+ For instance is this necessary in the Mobile Environment, because there
93
+ the ` localStorage ` doesn't exists. With ` App.registerStorage() ` we can register our own [ Storage] ( ../storage/Introduction.md ) .
88
94
89
95
### ` waitForMount `
90
96
91
- With ` waitForMount ` we define if AgileTs should wait
92
- with causing rerender on an unmounted Component until it got mounted.
97
+ With this flag we can determine
98
+ whether AgileTs should wait until unmounted
99
+ components are mounted before rerendering them.
93
100
``` ts
94
101
const App = new Agile ({
95
102
waitForMount: false // default true
@@ -99,12 +106,11 @@ const App = new Agile({
99
106
100
107
## 🟦 Typescript
101
108
102
- ` Agile Class ` is almost 100% typesafe.
109
+ The ` Agile Class ` is almost 100% typesafe.
103
110
104
111
## 🗺 Where to instantiate?
105
112
106
- You can instantiate the Agile Instance where ever you want.
107
- Directly in your Component, in an extra File or on Paper.
108
- It doesn't matter as long as you can work with it.
109
- There are a few [ Style Guides] ( ../../../../main/StyleGuide.md ) where you can get some inspiration
110
- how to structure an Application using AgileTs.
113
+ We can instantiate the Agile Instance of our application where ever we want.
114
+ Directly in our Component, in a separate file or on paper.
115
+ It doesn't matter as long as we can work with it.
116
+ There are a few [ Style Guides] ( ../../../../main/StyleGuide.md ) which might help us with such hard decision.
0 commit comments