Skip to content

Commit e924c06

Browse files
pisethxmonespiseth-ly
andauthored
fix(docs): fix typos and inconsistent wordings in docs (#72)
Co-authored-by: monespiseth-ly <[email protected]>
1 parent 2cf3e45 commit e924c06

File tree

14 files changed

+28
-28
lines changed

14 files changed

+28
-28
lines changed

docs/release-notes-v3.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ const alova = createAlova({
3030
Now you can directly use `alova/client` and `alova/server` as long as you install `alova`.
3131

3232
```javascript
33-
import vueHook from 'alova/vue';
34-
import reactHook from 'alova/react';
35-
import svelteHook from 'alova/svelte';
36-
import vueDemiHook from 'alova/vue-demi';
33+
import VueHook from 'alova/vue';
34+
import ReactHook from 'alova/react';
35+
import SvelteHook from 'alova/svelte';
36+
import VueDemiHook from 'alova/vue-demi';
3737
import { useRequest, useWatcher, usePagination } from 'alova/client';
3838
import adapterFetch from 'alova/fetch';
3939

4040
const alova = createAlova({
41-
statesHook: vueHook,
41+
statesHook: VueHook,
4242
requestAdapter: adapterFetch()
4343
});
4444
const { data, loading, error } = useRequest(alova.Get('/api/user'));
@@ -135,7 +135,7 @@ const alovaInst = createAlova({
135135
An example of handling cache avalanche, solved by adding random expiration time
136136

137137
```javascript
138-
alova.Get('/xxx', {
138+
alovaInst.Get('/xxx', {
139139
cacheFor: {
140140
expire: 100000 * Math.floor(Math.random() * 1000),
141141
mode: 'restore'

docs/tutorial/02-getting-started/02-quick-start.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const alovaInstance = createAlova({
7474
const { createAlova } = require('alova');
7575
const adapterFetch = require('alova/fetch');
7676

77-
const alova = createAlova({
77+
const alovaInstance = createAlova({
7878
requestAdapter: adapterFetch(),
7979
responded: response => response.json()
8080
});
@@ -89,7 +89,7 @@ const alova = createAlova({
8989
import { createAlova } from 'npm:alova';
9090
import adapterFetch from 'npm:alova/fetch';
9191

92-
const alova = createAlova({
92+
const alovaInstance = createAlova({
9393
requestAdapter: adapterFetch(),
9494
responded: response => response.json()
9595
});

docs/tutorial/02-getting-started/03-basic/07-combine-framework.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ const { data } = useWatcher(() => todoListGetter, [userInfo]);
255255
The data value will receive the transformed data format.
256256
257257
```typescript
258-
type data = {
258+
type Data = {
259259
// ...
260260
statusText: 'Completed' | 'In progress';
261261
}[];

docs/tutorial/02-getting-started/09-extension-integration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,13 @@ The contents of the `index` file are as follows:
233233
```js
234234
import { createAlova } from 'alova';
235235
import GlobalFetch from 'alova/GlobalFetch';
236-
import vueHook from 'alova/vue';
236+
import VueHook from 'alova/vue';
237237
import { createApis, withConfigType } from './createApis';
238238

239239
// The alova instance corresponding to the current api, you can modify the parameters here.
240240
export const alovaInstance = createAlova({
241241
baseURL: 'server parameter in openapi file',
242-
statesHook: vueHook,
242+
statesHook: VueHook,
243243
requestAdapter: GlobalFetch(),
244244
beforeRequest: method => {},
245245
responded: res => {

docs/tutorial/06-advanced/01-in-depth/10-typescript.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const {
7171
loading, // Accessor<boolean>
7272
data, // Accessor<{ data: any }>
7373
error // Accessor<Error>
74-
} = useRequest(svelteAlova.Get<{ data: any }>('/todo/list'));
74+
} = useRequest(solidAlova.Get<{ data: any }>('/todo/list'));
7575
```
7676

7777
</TabItem>

docs/tutorial/06-advanced/02-custom/01-http-adapter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ The global `beforeRequest`, `responded` interceptors, and the types of configura
162162
```javascript
163163
import type { AlovaRequestAdapter } from 'alova';
164164

165-
export type adapterFetch = () => AlovaRequestAdapter<FetchRequestInit, Response, Headers>;
165+
export type AdapterFetch = () => AlovaRequestAdapter<FetchRequestInit, Response, Headers>;
166166
```
167167

168168
The generic parameters in `AlovaRequestAdapter` are values ​​of three types: `RequestConfig`, `Response`, and `ResponseHeader`, which are automatically inferred to the types given by the request adapter in global interceptors, method instance configurations, etc.

docs/tutorial/07-project/01-best-practice/01-manage-apis.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export const orderAlova = createAlova({
7373

7474
// upload alova instance
7575
export const uploadAlova = createAlova({
76-
baseURL: 'https://api-order.alovajs.org',
76+
baseURL: 'https://api-upload.alovajs.org',
7777
statesHook: VueHook,
7878
requestAdapter: axiosRequestAdapter()
7979
});

i18n/zh-CN/docusaurus-plugin-content-docs/current/release-notes-v3.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ const alova = createAlova({
2828
现在只要安装`alova`就可以直接使用`alova/client``alova/server`
2929

3030
```javascript
31-
import vueHook from 'alova/vue';
32-
import reactHook from 'alova/react';
33-
import svelteHook from 'alova/svelte';
34-
import vueDemiHook from 'alova/vue-demi';
31+
import VueHook from 'alova/vue';
32+
import ReactHook from 'alova/react';
33+
import SvelteHook from 'alova/svelte';
34+
import VueDemiHook from 'alova/vue-demi';
3535
import { useRequest, useWatcher, usePagination } from 'alova/client';
3636
import adapterFetch from 'alova/fetch';
3737

3838
const alova = createAlova({
39-
statesHook: vueHook,
39+
statesHook: VueHook,
4040
requestAdapter: adapterFetch()
4141
});
4242
const { data, loading, error } = useRequest(alova.Get('/api/user'));
@@ -132,7 +132,7 @@ const alovaInst = createAlova({
132132
一个处理缓存雪崩的示例,通过添加随机过期时间解决
133133

134134
```javascript
135-
alova.Get('/xxx', {
135+
alovaInst.Get('/xxx', {
136136
cacheFor: {
137137
expire: 100000 * Math.floor(Math.random() * 1000),
138138
mode: 'restore'

i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorial/02-getting-started/02-quick-start.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const alovaInstance = createAlova({
7474
const { createAlova } = require('alova');
7575
const adapterFetch = require('alova/fetch');
7676

77-
const alova = createAlova({
77+
const alovaInstance = createAlova({
7878
requestAdapter: adapterFetch(),
7979
responded: response => response.json()
8080
});
@@ -89,7 +89,7 @@ const alova = createAlova({
8989
import { createAlova } from 'npm:alova';
9090
import adapterFetch from 'npm:alova/fetch';
9191

92-
const alova = createAlova({
92+
const alovaInstance = createAlova({
9393
requestAdapter: adapterFetch(),
9494
responded: response => response.json()
9595
});

i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorial/02-getting-started/03-basic/07-combine-framework.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ const { data } = useRequest(todoListGetter);
253253
data 值将接收到转换后的数据格式。
254254
255255
```typescript
256-
type data = {
256+
type Data = {
257257
// ...
258258
statusText: '已完成' | '进行中';
259259
}[];

0 commit comments

Comments
 (0)