Skip to content

Commit

Permalink
doc: update document.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Dec 11, 2024
1 parent 5e83b58 commit ac39e72
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,29 +338,29 @@ This guide provides the steps to migrate to the latest version of the configurat
### Key Changes

1. **Loader Functions Support Async**
- `LoaderFunc<T>` now supports returning `T` or `Promise<T>`.
- Update custom loaders to handle asynchronous operations if needed.

**Example:**
```ts
export type LoaderFunc<T> = (
filepath: string,
content: string,
jsOption?: LoadConfOption
) => T | Promise<T>;
```
- `LoaderFunc<T>` now supports returning `T` or `Promise<T>`.
- Update custom loaders to handle asynchronous operations if needed.

**Example:**
```ts
export type LoaderFunc<T> = (
filepath: string,
content: string,
jsOption?: LoadConfOption
) => T | Promise<T>;
```

2. **`autoConf` Returns a Promise**
- The `autoConf` function now returns a `Promise` instead of a synchronous result.
- Update your code to handle asynchronous calls.

**Example:**
```ts
export declare function autoConf<T>(
namespace?: string,
option?: AutoConfOption<T>
): Promise<{} & T>;
```
- The `autoConf` function now returns a `Promise` instead of a synchronous result.
- Update your code to handle asynchronous calls.

**Example:**
```ts
export declare function autoConf<T>(
namespace?: string,
option?: AutoConfOption<T>
): Promise<{} & T>;
```

### Migration Steps

Expand Down

0 comments on commit ac39e72

Please sign in to comment.