Skip to content

Commit

Permalink
PromiseValue: Fix documentation examples (#391)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronccasanova committed Apr 18, 2022
1 parent e3234d7 commit c5796f5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/promise-value.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ If the type is not a `Promise`, the type itself is returned.
import type {PromiseValue} from 'type-fest';
type AsyncData = Promise<string>;
let asyncData: PromiseValue<AsyncData> = Promise.resolve('ABC');
let asyncData: AsyncData = Promise.resolve('ABC');
type Data = PromiseValue<AsyncData>;
let data: Data = await asyncData;
Expand All @@ -20,8 +20,8 @@ type SyncData = PromiseValue<string>;
let syncData: SyncData = getSyncData();
// Here's an example that shows how this type reacts to recursive Promise types.
type RecursiveAsyncData = Promise<Promise<string> >;
let recursiveAsyncData: PromiseValue<RecursiveAsyncData> = Promise.resolve(Promise.resolve('ABC'));
type RecursiveAsyncData = Promise<Promise<string>>;
let recursiveAsyncData: PromiseValue<RecursiveAsyncData> = await Promise.resolve(Promise.resolve('ABC'));
```
@category Async
Expand Down

0 comments on commit c5796f5

Please sign in to comment.