技能 编程开发 本地存储抽象工具集

本地存储抽象工具集

v20260424
webiny-admin-local-storage-catalog
本模块提供了一套用于管理和抽象化浏览器本地存储(LocalStorage)的工具集。它包含多个抽象层和React Hooks,支持在组件内部进行命令式服务调用、观察单个或多个本地存储键值对。使用这些工具可以确保组件能够高效、准确地响应本地状态的变化,实现健壮的状态管理。
获取技能
480 次下载
概览

admin/local-storage

How to Use

  1. Find the abstraction you need below
  2. You MUST read the source file to get the exact interface and types!
  3. Import: import { Name } from "<importPath>";

Abstractions


Name: LocalStorage Import: import { LocalStorage } from "webiny/admin/local-storage" Source: @webiny/app/features/localStorage/abstractions.ts


Name: useLocalStorage Import: import { useLocalStorage } from "webiny/admin/local-storage" Source: @webiny/app/presentation/localStorage/index.ts Description: Returns the LocalStorage instance from DI. Useful when you want to call service methods imperatively inside components.


Name: useLocalStorageValue Import: import { useLocalStorageValue } from "webiny/admin/local-storage" Source: @webiny/app/presentation/localStorage/index.ts


Name: useLocalStorageValues Import: import { useLocalStorageValues } from "webiny/admin/local-storage" Source: @webiny/app/presentation/localStorage/index.ts Description: Observes multiple keys in LocalStorage and returns an object of { key: value }. Re-renders when any of the observed keys change.


信息
Category 编程开发
Name webiny-admin-local-storage-catalog
版本 v20260424
大小 1.3KB
更新时间 2026-04-28
语言