format: apply repo prettier (3.8.1) to the folded skills tree

963 markdown files reformatted with the repository's pinned prettier so
pnpm format:check covers the folded tree like every other repo file.

The formatter's embedded-language pass also normalized code fences
(TS semicolons, closed HTML tags in examples, lowercased CSS hex colors,
one renumbered list that skipped an index). Alphanumeric token deltas vs
the fold commit were audited file-by-file; all are formatter-equivalent
markup normalizations plus the four sanitized skills.
This commit is contained in:
fargo
2026-08-19 14:37:17 -05:00
parent d2eeb64433
commit 1a822493ba
962 changed files with 29594 additions and 27188 deletions
@@ -10,17 +10,14 @@ Computed for async functions
## Usage
```ts
import { computedAsync } from '@vueuse/core'
import { shallowRef } from 'vue'
import { computedAsync } from '@vueuse/core';
import { shallowRef } from 'vue';
const name = shallowRef('jack')
const name = shallowRef('jack');
const userInfo = computedAsync(
async () => {
return await mockLookUp(name.value)
},
null, /* initial state */
)
const userInfo = computedAsync(async () => {
return await mockLookUp(name.value);
}, null /* initial state */);
```
### Evaluation State
@@ -28,16 +25,18 @@ const userInfo = computedAsync(
You will need to pass a ref to track if the async function is evaluating.
```ts
import { computedAsync } from '@vueuse/core'
import { shallowRef } from 'vue'
import { computedAsync } from '@vueuse/core';
import { shallowRef } from 'vue';
const evaluating = shallowRef(false)
const evaluating = shallowRef(false);
const userInfo = computedAsync(
async () => { /* your logic */ },
async () => {
/* your logic */
},
null,
evaluating,
)
);
```
### onCancel
@@ -45,22 +44,21 @@ const userInfo = computedAsync(
When the computed source changed before the previous async function gets resolved, you may want to cancel the previous one. Here is an example showing how to incorporate with the fetch API.
```ts
import { computedAsync } from '@vueuse/core'
import { computedAsync } from '@vueuse/core';
// ---cut---
const packageName = shallowRef('@vueuse/core')
const packageName = shallowRef('@vueuse/core');
const downloads = computedAsync(async (onCancel) => {
const abortController = new AbortController()
const abortController = new AbortController();
onCancel(() => abortController.abort())
onCancel(() => abortController.abort());
return await fetch(
`https://api.npmjs.org/downloads/point/last-week/${packageName.value}`,
{ signal: abortController.signal },
)
.then(response => response.ok ? response.json() : { downloads: '—' })
.then(result => result.downloads)
}, 0)
return await fetch(`https://api.npmjs.org/downloads/point/last-week/${packageName.value}`, {
signal: abortController.signal,
})
.then((response) => (response.ok ? response.json() : { downloads: '—' }))
.then((result) => result.downloads);
}, 0);
```
### Lazy
@@ -68,16 +66,18 @@ const downloads = computedAsync(async (onCancel) => {
By default, `computedAsync` will start resolving immediately on creation, specify `lazy: true` to make it start resolving on the first accessing.
```ts
import { computedAsync } from '@vueuse/core'
import { shallowRef } from 'vue'
import { computedAsync } from '@vueuse/core';
import { shallowRef } from 'vue';
const evaluating = shallowRef(false)
const evaluating = shallowRef(false);
const userInfo = computedAsync(
async () => { /* your logic */ },
async () => {
/* your logic */
},
null,
{ lazy: true, evaluating },
)
);
```
## Caveats
@@ -94,24 +94,24 @@ const userInfo = computedAsync(
*
* @param cancelCallback The provided callback is invoked when a re-evaluation of the computed value is triggered before the previous one finished
*/
export type AsyncComputedOnCancel = (cancelCallback: Fn) => void
export type AsyncComputedOnCancel = (cancelCallback: Fn) => void;
export interface AsyncComputedOptions<Lazy = boolean> {
/**
* Should value be evaluated lazily
*
* @default false
*/
lazy?: Lazy
lazy?: Lazy;
/**
* Ref passed to receive the updated of async evaluation
*/
evaluating?: Ref<boolean>
evaluating?: Ref<boolean>;
/**
* Use shallowRef
*
* @default true
*/
shallow?: boolean
shallow?: boolean;
/**
* The flush option allows for greater control over the timing of a history point, default to `pre`
*
@@ -120,11 +120,11 @@ export interface AsyncComputedOptions<Lazy = boolean> {
* It works in the same way as the flush option in watch and watch effect in vue reactivity
* @default 'sync'
*/
flush?: WatchOptionFlush
flush?: WatchOptionFlush;
/**
* Callback when error is caught.
*/
onError?: (e: unknown) => void
onError?: (e: unknown) => void;
}
/**
* Create an asynchronous computed dependency.
@@ -138,22 +138,22 @@ export declare function computedAsync<T>(
evaluationCallback: (onCancel: AsyncComputedOnCancel) => T | Promise<T>,
initialState: T,
optionsOrRef: AsyncComputedOptions<true>,
): ComputedRef<T>
): ComputedRef<T>;
export declare function computedAsync<T>(
evaluationCallback: (onCancel: AsyncComputedOnCancel) => T | Promise<T>,
initialState: undefined,
optionsOrRef: AsyncComputedOptions<true>,
): ComputedRef<T | undefined>
): ComputedRef<T | undefined>;
export declare function computedAsync<T>(
evaluationCallback: (onCancel: AsyncComputedOnCancel) => T | Promise<T>,
initialState: T,
optionsOrRef?: Ref<boolean> | AsyncComputedOptions,
): Ref<T>
): Ref<T>;
export declare function computedAsync<T>(
evaluationCallback: (onCancel: AsyncComputedOnCancel) => T | Promise<T>,
initialState?: undefined,
optionsOrRef?: Ref<boolean> | AsyncComputedOptions,
): Ref<T | undefined>
): Ref<T | undefined>;
/** @deprecated use `computedAsync` instead */
export declare const asyncComputed: typeof computedAsync
export declare const asyncComputed: typeof computedAsync;
```