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

Commit 900d771

Browse files
committed
added doc search sub page
1 parent 67bb8f9 commit 900d771

File tree

3 files changed

+59
-10
lines changed

3 files changed

+59
-10
lines changed

docs/other/DocSearch.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
id: interfaces
3+
title: Interfaces
4+
sidebar_label: Interfaces
5+
slug: /docsearch
6+
---
7+
8+
Hello `docsearch` Team,
9+
10+
As you can see I am the maintainer of this documentation
11+
and have the rights to edit it ^^
12+
13+
With best regards
14+
15+
BennoDev

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

+35-1
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,39 @@ export interface CreateCollectionConfigInterface<DataType = DefaultItem> {
165165
}
166166
```
167167

168+
### `groups`
169+
Here we define the initial [Groups](#groups) of our Collection.
170+
We have two options to add them.
171+
The first way is to just pass an Array of Group Names, than
172+
AgileTs creates these Groups for us.
173+
```ts
174+
const MY_COLLECTION = App.createCollection({
175+
groups: ["myGroup1", "myGroup2"]
176+
});
177+
```
178+
But if we want to add some initial Items to the Groups we have to go the
179+
`function` config way.
180+
```ts
181+
const MY_COLLECTION = App.createCollection((collection) => ({
182+
key: 'dummyCollection',
183+
group: {
184+
myGroup1: collection.Group(["item1", "item2"]),
185+
myGroup2: collection.Group(["item5", "item2", "item6"])
186+
}
187+
}))
188+
```
189+
190+
### `key`
191+
The Key/Name is an optional property, that gets used to identify our Collection.
192+
This is pretty useful during debug sessions or if we persist our Collection,
193+
where it automatically uses the `key` as persist key.
194+
We recommend giving each Collection an unique `key`. It has only advantages.
195+
```ts
196+
const MY_COLLECTION = App.createCollection({
197+
key: "myKey"
198+
});
199+
```
200+
168201

169202
## 🟦 Typescript
170203

@@ -177,4 +210,5 @@ interface UserInterface {
177210
const MY_COLLECTION = App.createState<UserInterface>();
178211
MY_COLLECTION.collect({id: "invalidType", animal: "Lion"}); // Error
179212
MY_COLLECTION.collect({id: 1, name: "hans"}); // Success
180-
```
213+
```
214+
This type defines the Value Type of the Collection Items.

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

+9-9
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ By doing this the State gets automatically bound to the Agile Instance it was cr
1919
const MY_STATE = App.createState("Hello World");
2020
```
2121
There is also a way to use the plain `State Class`,
22-
but there we have to pass the `Agile Instance`, to which the State should get bound, beside the initial Value and config.
22+
but there we have to pass the `Agile Instance`, to which the State should get bound, beside the initial Value.
2323
```ts
2424
const MY_STATE = new State(App, "Hello World");
2525
```
@@ -38,7 +38,7 @@ MY_STATE.undo().set("Hello Hell").watch(() => {}).reset().invert().persist().typ
3838

3939
## 📭 Props
4040

41-
`State` takes, beside the initial value an optional configuration object.
41+
A `State` takes, beside the initial value an optional configuration object.
4242
```ts
4343
const MY_STATE = App.createState("myInitialValue", {
4444
key: "myKey",
@@ -56,8 +56,8 @@ export interface StateConfigInterface {
5656
```
5757

5858
### `key`
59-
The Key/Name is an optional property, that gets used to identify a State.
60-
This is pretty useful during debug sessions or if we persist a State,
59+
The Key/Name is an optional property, that gets used to identify our State.
60+
This is pretty useful during debug sessions or if we persist our State,
6161
where it automatically uses the `key` as persist key.
6262
We recommend giving each State an unique `key`. It as only advantages.
6363
```ts
@@ -74,9 +74,9 @@ Gets mostly used internal and has properly no use for you.
7474

7575
:::
7676

77-
`Dependents` is used to detect States, that depend on this State.
77+
Here we define which States depend on our State.
7878
This means if our State gets mutated and ingested into the Runtime,
79-
the depending State gets also ingested into the Runtime.
79+
the depending States gets also ingested into the Runtime.
8080
```ts
8181
const MY_STATE = App.createState("myInitialValue", {
8282
dependents: [MY_STATE_2]
@@ -91,8 +91,8 @@ Gets mostly used internal and has properly no use for you.
9191

9292
:::
9393

94-
With `isPlaceholder` we define, that this State is a placeholder.
95-
Mostly a State is a Placeholder if we want to hold a reference to a State that hasn't been instantiated yet.
94+
With `isPlaceholder` we define, that our State is a placeholder.
95+
Mostly a State is a Placeholder if we want to hold a reference to it, because hasn't been instantiated yet.
9696
```ts
9797
const MY_STATE = App.createState("myInitialValue", {
9898
isPlaceholder: true
@@ -112,4 +112,4 @@ Javascript users can also get rudimentary typesafe, with the `type` function.
112112
```ts
113113
MY_STATE.type(String); // Now State only accept State Values
114114
```
115-
Be aware that the `type` function currently only supports primitive types.
115+
Be aware that the `type` function currently only supports primitive types.

0 commit comments

Comments
 (0)