Vize

コンポーザブルのリファレンス

@vizejs/composable の各エントリーポイントの API をソースから生成したリファレンスです。SSR とハイドレーション時の動作、リソースの解放、対応する実行環境も確認できます。個別の API 説明は英語です。

動作から選ぶ

作りたい動作から使用例を選べます。リンク先の API 説明と操作画面は英語です。各ページに、操作できるプレビュー、確認する状態の変化、そのままコピーできる Vue SFC を掲載しています。プレビューと掲載コードには同じ SFC を使っています。

やりたいこと Composable
入力に合わせて広がる欄でリリースノートを書く textarea-autosize
配送の見積もりを取得し、中止や再試行を行う async-resource
1,000 件のガイドを検索して一覧をスクロールする virtual-list
配送の詳細を開閉する use-toggle
ワークショップの予約人数を増減する use-counter
入力が落ち着いてからガイドを検索する use-debounced
表示名を入力して検証する use-field
リリースのタイトルを編集して元に戻す use-history
ガイドの一覧をページに分ける use-offset-pagination
下書きのレビュー時間を計る use-interval
レビューのリマインダーを予約する use-timeout
チーム情報を取得し、失敗したら再試行する use-async-state
ガイドの読書位置を保存する use-storage
画面の広さに合わせておすすめを変える media-query
入力中のプロフィール項目に説明を表示する active-element
ワークショップの申込内容を検証する use-form
申込内容を手順に沿って確認・編集する use-stepper
項目の識別子を保って参加セッションを選ぶ use-selection
コンポーネントの確認ポイントを順に表示する use-cycle-list
入力欄のフォーカスを確認・移動する focus
設定の外側をクリックして閉じる on-click-outside
選んだ操作部品でショートカットを受け付ける on-key-stroke
選んだ下書きの入力イベントを監視する event-listener
編集したインストールコマンドをコピー・読み取りする use-clipboard
準備ガイドの表示位置をスクロールする scroll
選んだパネルのサイズを監視する resize-observer
スクロール領域内でカードが見えるか確認する intersection-observer
ガイドのパネルの位置と大きさを測る element-bounding
カードにポインターを置いてから説明を表示する element-hover
ボタンの長押し中にレビューのメモを表示する on-long-press
文字入力を始めたらガイドの検索欄に移動する on-start-typing
オフラインでもガイドの下書きを編集する network
配色を選ぶ、またはシステムの設定に合わせる color-mode
画面幅に合わせてガイドの詳しさを変える breakpoints
画面の大きさに合わせてカードを並べる window-size
操作領域のポインターイベントを確認する pointer
画面内と要素内のマウス座標を比較する mouse-in-element
決めた範囲内でメモをドラッグする draggable
編集できる文章の選択範囲を確認する text-selection
タイトルの編集中に一定間隔でプレビューを更新する use-throttled
読み手の地域に合う形式で注文金額を表示する use-number-format
登壇者の名前を自然な列挙形式で表示する use-list-format
未読件数に合わせて単語の形を選ぶ use-plural-rules
条件を確認しながら購入手続きを進める use-machine
チケット価格の前回からの変化を表示する use-previous
ログインコードを再送できるまでの時間を表示する use-countdown
イベントの開催時刻を現在からの相対表現で示す use-relative-time-format
持ち物リストにチェックを付ける use-array
フォローする話題を選ぶ use-set
カート内の商品の個数を管理する use-map
文書を追加した順に印刷する use-queue
前の画面に戻るための履歴を管理する use-stack
スコアを順位順に並べる use-sorted
言語に合う順序で名前を並べる use-sorted-locale
計算済みの送料を再利用する use-memoize
繰り返すフォーム項目に識別子を付ける use-id-generator
指定したタイムゾーンで開始時刻を表示する use-date-format
読み手の地域に合う形式で日付を表示する use-date-time-format
言語の名前を表示する use-display-names
投稿文の文字数を数える use-segmenter
現在時刻を更新して表示する use-now
下書きを保存してからの経過時間を表示する use-time-ago
ブラウザーが機能に対応しているか確認する use-supported
マウント後にブラウザー専用の内容を表示する use-mounted
下書きの削除前に確認する use-confirm-dialog
依存する処理を順に実行する use-async-queue
v-model と内部の状態を使い分ける use-v-model
入力欄をラベルやエラー表示と結び付ける use-form-field-props
選択したタブを URL のクエリーに残す use-route-query
URL のハッシュでページ内の節に移動する use-url-hash
検索条件をアドレスバーに残す use-url-search-params
配色の設定を Cookie に保存する use-cookie
下書きを IndexedDB に保存する use-indexed-db
CSS 変数でカードの見た目を変える use-css-var
ブラウザーのタブのタイトルに未読件数を表示する use-document-title
タブのアイコンでビルドの状態を伝える use-favicon
機能を使っている間だけ CSS を追加する use-style-tag
必要になったら外部のウィジェットを読み込む use-script-tag
入力した文章をファイルとしてダウンロードする use-object-url
画像を取得し、失敗したら代わりの表示を出す use-image
操作に応じて更新情報を取得する use-fetch
サーバーから届くイベントを受け取る use-event-source
WebSocket でチャットに接続する use-websocket
別のタブに下書きの変更を知らせる use-broadcast-channel
重い計算を Web Worker で実行する use-worker-fn
アップロード前に文章を圧縮する use-compression-stream
進捗バーをアニメーションで動かす use-raf-fn
ブラウザーの空き時間に分析データを送る use-request-idle-callback
優先度に応じて処理を実行する use-scheduler-post-task
書き出し処理を一度に一つだけ実行する use-web-locks
レイアウトの切り替えをアニメーションで示す use-view-transition
ページのリクエストにかかった時間を測る use-performance-observer
Core Web Vitals の計測値を表示する use-web-vitals
ストレージの使用量を確認する use-storage-estimate
モバイルで実際に見えている領域を調べる use-visual-viewport
ユーザーが最初に操作したことを確認する use-user-activation
ウィザードの手順をブラウザーの履歴に残す use-navigation-api
ドロップした画像を受け付ける use-drop-zone
用意したボタンからファイルを選ぶ use-file-dialog
音声の再生コントロールを作る use-media-controls
心拍計とペアリングする use-bluetooth
HID デバイスに接続する use-hid
マイコンのログを読み取る use-serial
USB デバイスへのアクセスを許可する use-usb
MIDI コントローラーの一覧を表示する use-web-midi
接続されたゲームコントローラーを表示する use-gamepad
ブラウザーの支払い画面を開く use-payment-request
パスキーでのログインを用意する use-web-authn
連絡先から招待する相手を選ぶ use-contact-picker
画面上の色を取得する use-eye-dropper
写真に写った QR コードを読み取る use-barcode-detector
ローカルのファイルを直接編集する use-file-system-access
スライドを全画面で表示する use-fullscreen
トークの開始前に通知する use-notification
権限の状態に応じて表示を変える use-permission
リンクを共有する use-share
振動で操作への反応を伝える use-vibrate
画面が自動で消えないようにする use-wake-lock
接続された別の画面を探す use-screen-details
画面を共有する use-display-media
カメラの映像をプレビューする use-user-media
音声で検索語を入力する use-speech-recognition
案内を音声で読み上げる use-speech-synthesis
オフラインで使う準備をする use-service-worker
予定の通知を購読する use-push-subscription
端末内でコメントの言語を判定する use-builtin-ai

最小構成

vp install @vizejs/composable

Vue 3.5 以降のプロジェクトにインストールし、使用例のページにある SFC 全体をコピーしてください。監視・イベント購読・タイマーを持つ関数は <script setup> 内で呼び出します。コンポーネントが破棄されると、対応する監視や購読、タイマーも解除されます。

カメラや Bluetooth などの例は、ブラウザーの対応状況、接続した機器、権限によって試せる操作が変わります。プレビューで対応していない機能の表示を確認できても、実機での接続や許可後の動作まで検証済みとは限りません。各ページの対応範囲と、実行環境を確認してください。

全 API

以下は全公開エントリーのソース由来リファレンスです。上記の 126 例以外については、ライブプレビューでの検証をまだ行っていません。

async

Entry Exports Summary
abort-signal anyAbortSignal, timeoutAbortSignal, deadlineAbortSignal Create a signal that aborts when the first input signal aborts.
async-resource useAsyncResource Create a scoped, abortable asynchronous resource with latest-result-wins state.
retry-async retryAsync Execute an operation with bounded, abortable retries and deterministic delay policy.
use-async-queue useAsyncQueue Run async tasks one after another, each receiving the previous result.
use-async-state useAsyncState Reactive state for an async producer.
use-web-locks useWebLocks Coordinate work across tabs and workers with the Web Locks API.

capability

Entry Exports Summary
capability availableCapability, unavailableCapability, isCapabilityAvailable, isCapabilityUnavailable Create an available capability supplied directly by the current runtime.
use-contact-picker useContactPicker Let the user share contacts with the Contact Picker API.
use-payment-request usePaymentRequest Collect payments with a typed Payment Request API wrapper.
use-permission usePermission Observe a browser permission reactively.
use-screen-details useScreenDetails, placeWindow, snapshotScreen Snapshot a ScreenDetailed into a plain object.
use-supported useSupported Hydration-stable feature detection.
use-web-authn useWebAuthn, encodeBase64Url, decodeBase64Url, parseCreationOptionsFromJSON, parseRequestOptionsFromJSON, serializeRegistrationCredential, serializeAuthenticationCredential Encode bytes as unpadded base64url.

dom

Entry Exports Summary
active-element useActiveElement Track the focused element of a document.
animate useAnimate Drive the Web Animations API reactively with typed keyframes.
element-bounding useElementBounding Track an element's getBoundingClientRect() reactively.
element-by-point useElementByPoint Track the element(s) under a client coordinate.
element-ref useElementRef Capture a template element through a function ref.
element-target isElementNode, resolveElement, resolveElements Whether a value is a DOM element node.
focus useFocus, useFocusWithin Track and control focus of a single element.
infinite-scroll useInfiniteScroll Load more content when a scroll container reaches an edge.
intersection-observer useIntersectionObserver, useElementVisibility Observe the intersection of reactive elements with a root.
mutation-observer useMutationObserver Observe DOM mutations of reactive elements.
parent-element useParentElement Track the parent element of a reactive element target.
resize-observer useResizeObserver, useElementSize Observe size changes of one or more reactive elements.
scroll useScroll, useWindowScroll Track the scroll offset, edges, and direction of an element or window.
scroll-lock useScrollLock Lock scrolling of a single element by toggling overflow: hidden.
text-selection useTextSelection Track the document text selection.
textarea-autosize useTextareaAutosize Grow a textarea to fit its content.
use-css-var useCssVar Read and write a CSS custom property reactively.
use-document-title useDocumentTitle Bind the document title to reactive state.
use-favicon useFavicon Bind the page favicon to reactive state.
use-script-tag useScriptTag Inject a <script> tag and track its loading state.
use-style-tag useStyleTag Inject a reactive <style> element.
use-view-transition useViewTransition Animate DOM updates with the View Transition API.
use-visual-viewport useVisualViewport Track the visual viewport and on-screen keyboard.
virtual-list useVirtualList Render only the visible slice of a long list (fixed or variable item sizes).
window-size useWindowSize Track the window size reactively.

events

Entry Exports Summary
create-event-hook createEventHook Create a small, strongly typed event emitter.
document-visibility useDocumentVisibility Observe document visibility without touching browser globals during module evaluation.
event-listener useEventListener Attach an event listener to a reactive target and clean it up with the current reactive scope.
on-click-outside onClickOutside Call a handler when the user clicks (or focuses an iframe) outside an element.
page-leave usePageLeave Detect when the mouse leaves the page (for exit-intent UI).
use-drop-zone matchesAccept, useDropZone Test a file against accept-attribute style patterns.

i18n

Entry Exports Summary
i18n defineMessages, defineLocale, defineI18n, useI18n Declare typed message catalogs for several locales.
icu-message parseMessage, createMessageFormatter, formatMessage Parse an ICU MessageFormat string into an AST.
locale useLocale Create reactive locale metadata and platform-native formatter factories.
preferred-languages usePreferredLanguages Track the user's preferred languages (navigator.languages).
use-builtin-ai useLanguageDetector, useSummarizer, useTranslator Translate text on-device with Chrome's built-in Translator API.
use-date-format formatDate, useDateFormat Format a date with a token pattern or Intl.DateTimeFormat options.
use-date-time-format useDateTimeFormat Format dates and times reactively with Intl.DateTimeFormat.
use-display-names useDisplayNames Localized names of languages, regions, scripts, currencies, calendars, and date-time fields (Intl.DisplayNames): "JP" → "Japan", "ja" → "日本語" in Japanese, "EUR" → "Euro".
use-list-format useListFormat Join strings into a locale-aware list with Intl.ListFormat ("a, b, and c", "a、b、c", "a, b or c").
use-number-format useNumberFormat Format numbers reactively with Intl.NumberFormat.
use-plural-rules usePluralRules Choose and render a message by CLDR plural category (Intl.PluralRules).
use-relative-time-format selectRelativeTimeUnit, useRelativeTimeFormat Pick the largest unit that expresses a millisecond difference as a non-zero rounded amount: seconds below a minute, minutes below an hour, hours below a day, days below a week, weeks below a month, months below a year, and years otherwise (Gregorian average month/year lengths).
use-segmenter useSegmenter Split text into graphemes, words, or sentences with Intl.Segmenter.
use-sorted-locale useSortedLocale Sort strings locale-aware with Intl.Collator.
use-time-ago formatTimeAgo, useTimeAgo Format the distance between two instants as a localized relative phrase.

input

Entry Exports Summary
draggable useDraggable Make an element draggable with Pointer Events.
element-hover useElementHover Track whether the pointer hovers an element.
magic-keys DEFAULT_KEY_ALIASES, normalizeKeyName, useMagicKeys, useKeyPressed Default aliases resolved before matching combos.
mouse useMouse Track the mouse (and optionally touch) position.
mouse-in-element useMouseInElement Track the pointer position relative to an element.
on-key-stroke onKeyStroke, onKeyDown, onKeyUp Run a handler when matching keys are pressed.
on-long-press onLongPress Call a handler when an element is pressed and held.
on-start-typing isTypingKeystroke, onStartTyping Whether a keyboard event would type a printable character.
pinch usePinch Recognize two-pointer pinch/rotate gestures on an element.
pointer usePointer, toPointerKind Track the latest pointer (mouse, touch, or pen) state.
pointer-lock PointerLockError, usePointerLock Error thrown when pointer lock cannot be acquired or released.
swipe swipeDirection, useSwipe, usePointerSwipe Classify a displacement into a SwipeDirection.
use-gamepad useGamepad, mapGamepad, snapshotGamepad, standardGamepadButtons, standardGamepadAxes Button indices of the W3C "standard" gamepad mapping.
use-user-activation useUserActivation Track sticky and transient user activation with the User Activation API.

lifecycle

Entry Exports Summary
disposal-scope DISPOSAL_ERROR_CODE, DisposalError, createDisposalScope Stable error code reported when one or more owned cleanups fail.
scope tryOnScopeDispose Register cleanup in the active reactive scope when one exists.
use-mounted useMounted Whether the calling component has mounted.

media

Entry Exports Summary
breakpoints breakpointsTailwind, breakpointsBootstrapV5, useBreakpoints, toPixels Tailwind CSS default breakpoints.
color-mode useColorMode, useDark Reactive color mode with persistence and DOM application.
device-pixel-ratio useDevicePixelRatio Track window.devicePixelRatio (zoom and moving between displays).
media-query useMediaQuery, useReducedMotion Evaluate a reactive media query without requiring browser globals.
preferences usePreferredDark, usePreferredColorScheme, usePreferredContrast, usePreferredReducedTransparency Whether the user prefers a dark color scheme.
use-barcode-detector useBarcodeDetector Detect barcodes and QR codes with the Barcode Detection API.
use-display-media useDisplayMedia Capture a screen, window, or tab with getDisplayMedia.
use-image useImage Preload an image and track its loading state.
use-media-controls useMediaControls Two-way reactive controls for a <video> or <audio> element.
use-object-url useObjectUrl Create a reactive object URL for a Blob, File, or MediaSource.
use-speech-recognition useSpeechRecognition Transcribe speech with the Web Speech API.
use-speech-synthesis useSpeechSynthesis Speak text with the Web Speech API.
use-user-media useMediaStream, useUserMedia Manage the lifecycle of a media stream from any asynchronous source.

networking

Entry Exports Summary
network useNetwork, useOnline Track connectivity and connection quality.
use-broadcast-channel useBroadcastChannel Exchange typed messages with other tabs, windows, and workers of the same origin through the Broadcast Channel API.
use-event-source useEventSource Reactive Server-Sent Events stream with typed, per-event decoding.
use-fetch useFetch Fetch typed data with a custom parse decoder.
use-push-subscription usePushSubscription Manage a Web Push subscription.
use-service-worker useServiceWorker Register a service worker and follow its update lifecycle.
use-websocket useWebSocket Open a WebSocket with raw payloads.

other

Entry Exports Summary
resolver VIZE_COMPOSABLE_PACKAGE, VizeComposableResolver, createVizeComposableDeclarations, listVizeComposableImports, readComposableLockfile, vizeComposableImports Package that owns the resolvable exports.
timeout-scheduler — Single-shot timer host used by the debounced and throttled state utilities. Implement this interface to integrate a deterministic test clock, a native runtime timer, or an application-owned scheduler. Handles are opaque: the utilities only hand them back to TimeoutScheduler.clearTimeout. This module declares types only and contributes no runtime code.
watch-source — Shared source and callback typing for the watch helpers (watchDebounced, watchThrottled, watchPausable, watchIgnorable, watchOnce, whenever). The helpers accept the same sources as Vue's watch: a ref, a getter, a reactive object, or a tuple of those. This module declares types only and contributes no runtime code.

performance

Entry Exports Summary
fps useFps Measure the rendering frame rate with requestAnimationFrame.
use-memoize useMemoize Cache a function's results per argument list.
use-performance-observer usePerformanceObserver Observe performance entries with callbacks typed by entry type.
use-web-vitals WEB_VITALS_THRESHOLDS, rateMetric, useWebVitals Standard [good, poor] thresholds: values up to the first bound are "good", values above the second are "poor".
use-worker-fn createWorkerFnScript, useWorkerFn Build the worker script for fn.

reactivity

Entry Exports Summary
computed-async computedAsync Computed value backed by an async evaluator.
computed-with-control computedWithControl Computed value whose dependencies are declared explicitly.
reactify reactify Turn a plain function into one that accepts refs/getters and returns a computed result.
ref-auto-reset refAutoReset Writable ref that falls back to a default value afterMs milliseconds after each write.
ref-default refDefault View a nullable ref through a default value.
sync-ref syncRef Keep two refs in sync, optionally converting between their types.
to-reactive toReactive Reactive object view over a ref that holds an object.
until until Await a reactive source reaching a condition.
use-v-model useVModel, useVModels Two-way binding helper for a component prop.
watch-ignorable watchIgnorable Watch sources like Vue's watch, with a way to make changes the callback should not see.
watch-once watchOnce Watch sources like Vue's watch, delivering exactly one change and then stopping.
watch-pausable watchPausable Watch sources like Vue's watch, with pause and resume.
whenever whenever Run a callback whenever a source becomes (or changes while) truthy.

sensors

Entry Exports Summary
device-motion useDeviceMotion Track device acceleration and rotation rate.
device-orientation useDeviceOrientation, requestMotionPermission Track device orientation angles.
geolocation useGeolocation Watch the device position with the Geolocation API.

state

Entry Exports Summary
create-global-state createGlobalState Lift a state factory into application-wide state shared by every caller.
create-injection-state createInjectionState Create a typed provide/inject pair around a composable, for component subtrees that share request-local state.
create-shared-composable createSharedComposable Share one instance of a composable between all simultaneously mounted callers, reference-counted by their effect scopes.
math useClamp, useRound, useProjection Number kept inside [min, max].
standard-schema formatSchemaPath, isStandardSchema, validateStandardSchema Whether a value implements the Standard Schema v1 protocol.
use-array useArrayFilter, useArrayMap, useArrayFind, useArrayReduce, useArraySome, useArrayEvery, useArrayUnique Reactive Array.prototype.filter.
use-confirm-dialog useConfirmDialog Promise-based confirm dialog state machine (idle → revealed → idle), independent of any dialog markup.
use-counter useCounter Create a clamped counter whose every transition stays inside [min, max].
use-cycle-list useCycleList Cycle through a list with wrap-around navigation.
use-field useField A standalone validated field, independent of any form.
use-form useForm Fully typed form state with validation, field arrays, and submission.
use-form-field-props formFieldId, toFormFieldErrors, useFormErrorSummaryFields, useFormFieldProps Derive the default control id for a path.
use-history useHistory Record bounded undo/redo history over the writes of a ref.
use-id-generator useIdGenerator Create an SSR-stable id factory for one component.
use-machine useMachine Finite state machine with typed states, events, and targets.
use-map useMap Create a reactive Map with typed helpers.
use-offset-pagination useOffsetPagination Offset-based pagination state.
use-previous usePrevious Track the value a reactive source held before its latest change.
use-queue useQueue Create a typed reactive FIFO queue.
use-route-query queryParsers, oneOf, useRouteQuery, useRouteParams Built-in QueryParsers.
use-selection useSelection Generic single- or multi-select state for lists, tables, and grids.
use-set useSet Create a reactive Set with typed helpers.
use-sorted useSorted Sorted copy of a reactive array; the source is never mutated.
use-stack useStack Create a typed reactive LIFO stack.
use-stepper useStepper Linear multi-step flow (wizards, onboarding, checkout) with typed step names.
use-toggle useToggle Create owned boolean state with an inverting control.
use-url-hash useUrlHash Track the URL fragment as a typed value decoded by parse.
use-url-search-params parseSearchParams, searchParam, serializeSearchParams, useUrlSearchParams Built-in typed codecs for useUrlSearchParams schemas.

storage

Entry Exports Summary
use-cookie COOKIE_ADAPTER_KEY, parseCookieHeader, provideCookieAdapter, serializeCookie, useCookie Parse a Cookie request header (or document.cookie) into name/value pairs.
use-file-system-access useFileSystemAccess Open, edit, and save local files with the File System Access API.
use-indexed-db createIndexedDBKeyval, useIndexedDB Create a small promise-based key-value store on one IndexedDB object store.
use-storage inferStorageSerializerKind, storageSerializers, useLocalStorage, useSessionStorage, useStorage Typed built-in serializers, usable directly as the serializer option.
use-storage-estimate usePersistentStorage, useStorageEstimate Track the origin's storage usage and quota with navigator.storage.estimate().

system

Entry Exports Summary
battery useBattery Track the device battery with the Battery Status API.
idle DEFAULT_IDLE_EVENTS, useIdle Default activity events.
screen-orientation useScreenOrientation Track the screen orientation.
use-bluetooth useBluetooth Connect to Bluetooth Low Energy devices with the Web Bluetooth API.
use-clipboard useClipboard Permission-aware clipboard access with a legacy copy fallback.
use-compression-stream compress, decompress, decompressText, useCompressionStream Compress data with the Compression Streams API.
use-eye-dropper useEyeDropper Pick a color from anywhere on screen with the EyeDropper API.
use-file-dialog useFileDialog Open the native file picker without rendering an input.
use-fullscreen useFullscreen Enter, exit, and observe fullscreen for an element.
use-hid useHID Talk to human-interface devices with the WebHID API.
use-navigation-api useNavigationApi Reactive access to the Navigation API (window.navigation).
use-notification useWebNotification Show typed Web Notifications with permission handling.
use-serial useSerial Talk to serial devices with the Web Serial API.
use-share useShare Share text, links, and files through the platform share sheet.
use-usb useUSB Talk to USB devices with the WebUSB API.
use-vibrate useVibrate Drive the Vibration API with validated, optionally repeating patterns.
use-wake-lock useWakeLock Keep the screen awake with the Screen Wake Lock API.
use-web-midi useWebMIDI Access MIDI devices with the Web MIDI API.

timing

Entry Exports Summary
ref-debounced refDebounced Readonly ref that follows source after it stayed quiet for waitMs.
retry-delay calculateRetryDelay Calculate a bounded exponential-backoff delay for a one-based retry.
temporal Temporal, TemporalIntl, useTemporalNow, useTemporalZonedDateTime Creates a pauseable Temporal clock whose timer follows the current Vue effect scope.
transition TransitionPresets, useTransition, cubicBezier Named cubic Bézier easing presets (the classic easings.net set).
use-countdown useCountdown Count down from a number of ticks to zero.
use-debounced useDebounced Create a readonly debounced view of a reactive source.
use-interval useIntervalFn, useInterval Call a function on a fixed, pausable interval.
use-now useTimestamp, useNow Reactive Unix timestamp in milliseconds.
use-raf-fn useRafFn Run a callback on every animation frame, with pause/resume controls and an optional frame-rate cap.
use-request-idle-callback idle, useRequestIdleCallback Run a callback in the next idle period with requestIdleCallback.
use-scheduler-post-task useSchedulerPostTask Post prioritized tasks with the Prioritized Task Scheduling API.
use-throttled useThrottled Create a readonly throttled view of a reactive source.
use-timeout useTimeoutFn, useTimeout Call a function once after a delay, with restart and cancel controls.
watch-debounced watchDebounced Watch sources like Vue's watch, but run the callback only after the sources stayed quiet for debounce milliseconds.
watch-throttled watchThrottled Watch sources like Vue's watch, but run the callback at most once per cooldown window.