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

Commit 33aa2a6

Browse files
committed
fixe typos
1 parent 028d626 commit 33aa2a6

File tree

5 files changed

+32
-17
lines changed

5 files changed

+32
-17
lines changed

docs/examples/vue/examples/FirstCollection.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ slug: /examples/vue/first-collection
77

88
import {CodeSandBoxEmbed} from "../../../../src/components/docs/CodeSandBoxEmbed";
99

10-
<CodeSandBoxEmbed uri={'todo'} />
10+
<CodeSandBoxEmbed uri={'agilets-first-state-i5xxs'} />

docs/examples/vue/examples/FirstState.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ slug: /examples/vue/first-state
77

88
import {CodeSandBoxEmbed} from "../../../../src/components/docs/CodeSandBoxEmbed";
99

10-
<CodeSandBoxEmbed uri={'todo'} />
10+
<CodeSandBoxEmbed uri={'agilets-first-state-i5xxs'} />

docs/main/Frameworks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ A quick overview of all frameworks that AgileTs supports or has planned to suppo
1818
| [React](https://reactjs.org) || - |
1919
| [React-Native](https://reactnative.dev/) || - |
2020
| [Angular](https://angular.io/) |||
21-
| [Vue](https://vuejs.org/) | ||
21+
| [Vue](https://vuejs.org/) | 🟨 | |
2222
| [Svelte](https://svelte.dev/) || - |
2323

2424
### 🤖 SSR-Frameworks

docs/packages/vue/Introduction.md

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ It also offers some other valuable functionalities that optimize the workflow us
3737
The `bindAgileInstances()` method binds/subscribes States to Vue Components.
3838
This binding ensures that the Component rerenders whenever a bound State mutates.
3939
We can flexibly bind any State to any Vue Component.
40-
```ts
40+
```ts {4-7}
4141
export default {
4242
name: 'MyComponent',
4343
data: function () {
@@ -49,11 +49,19 @@ export default {
4949
},
5050
};
5151
```
52-
`bindAgileInstances()` returns a keymap object based on the passed State `value`.
53-
This keymap we merge into the `data` object, to access the State `values` in our `html` code like local Vue State.
54-
However, the AgileTs State `values` are under the `sharedState` property located
55-
to separate them a little from the local Vue States.
56-
```ts
52+
`bindAgileInstances()` returns a State value keymap based on the passed States.
53+
We merge the returned keymap into the `data` object
54+
to access the State `values` in the `html` code like we would local Vue States.
55+
```vue {3}
56+
<template>
57+
<div id="app">
58+
<p>myState: {{ sharedState.myState }}</p>
59+
</div>
60+
</template>
61+
```
62+
Note that the AgileTs State `values` are under the `sharedState` property located
63+
to separate them from the local Vue States.
64+
```ts {4-7}
5765
const MY_STATE = App.createState('jeff');
5866
const MY_STATE_2 = App.createState('frank');
5967

@@ -62,8 +70,10 @@ this.bindAgileInstances({
6270
myState2: MY_STATE_2,
6371
}); // Returns '{myState: 'jeff', mayState2: 'frank'}'
6472
```
65-
We don't have to define separate keymap keys, if our State has already a valid key.
66-
```ts
73+
Instead of a States keymap we can also pass an array of States.
74+
But keep in mind that then the passed States require a unique `key`
75+
to be properly mapped into the returned State `value` keymap.
76+
```ts {4-7}
6777
const MY_STATE = App.createState('jeff', {key: 'myState'});
6878
const MY_STATE_2 = App.createState('frank');
6979

@@ -72,11 +82,15 @@ this.bindAgileInstances([
7282
MY_STATE_2,
7383
]); // Returns '{myState: 'jeff'}'
7484
```
75-
But if we use this variant, and the State has no key, it will be ignored.
85+
Passed States without a valid `key` are ignored
86+
and won't be represented by the returned keymap.
87+
Thus, the State `value` isn't accessible in the `html` code,
88+
and a State mutation rerender is triggered via. `vueComponent.forceRerender()`
89+
instead of mutating the `data` object.
7690

7791
### 🟦 Typescript
7892

79-
The `bindAgileInstances` isn't typesafe. But we are working on it.
93+
The `bindAgileInstances` isn't typesafe yet. But we are working on it.
8094

8195
## 🚀 Quick Links
8296
- [Installation](./Installation.md)

docs/quick_start/Vue.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ slug: /quick-start/vue
88
:::warning
99

1010
**The Vue integration is currently 'Work in Progress'**
11-
and hasn't yet been tested extensively! But as far as I can tell, it works quite good, with some type limitations.
11+
and hasn't yet been tested extensively!
12+
But as far as I can tell, it works well, with some type limitations.
1213

1314
:::
1415

@@ -84,7 +85,7 @@ In summary, the main tasks of the `Agile Class` are to:
8485

8586
### 👨‍💻 Example {#example-1}
8687

87-
To better understand how to use a State, we should view it in an example.
88+
To better understand how to use an Agile State in Vue, we should view it in an example.
8889
The sample project we'll look at is a small counter that lets us increase a number as we click the 'Update State' button.
8990
It may not be fascinating, but it shows all the essential pieces of a Vue + AgileTs application in action.
9091
After checking out the example, we recommend taking a look at the [Important Code Snippets Section](#important-code-snippets-1) below,
@@ -130,7 +131,7 @@ const MY_FIRST_STATE = App.createState("Hello World");
130131
}
131132
</script>
132133
```
133-
Check out the [code sandbox](https://codesandbox.io/s/todo) to see the whole example in a production near environment.
134+
Check out the [code sandbox](https://codesandbox.io/s/agilets-first-state-i5xxs) to see the whole example in a production near environment.
134135

135136
### 💻 Important Code Snippets {#important-code-snippets-1}
136137

@@ -168,7 +169,7 @@ Unfortunately, we haven't managed to make it typesafe yet. But we are working on
168169
4️⃣ After binding the States to the Vue Component (Step 3),
169170
we can access it like a local State in the `html` code.
170171
However, the AgileTs State `values` are under the `sharedState` property located
171-
to separate them a little from the local Vue States.
172+
to separate them from the local Vue States.
172173

173174
```ts
174175
MY_FIRST_STATE.set(`Hello World ${++helloWorldCount}`);

0 commit comments

Comments
 (0)