首页/前端开发/valtio-define
V

valtio-define

by @hairyfv1.0.0
0.0(0)

Comprehensive skills for working with valtio-define

ValtioReact State ManagementProxy-based StateFrontend DevelopmentJavaScript LibrariesGitHub
安装方式
npx skills add hairyf/skills --skill valtio-define
compare_arrows

Before / After 效果对比

0

description 文档


name: valtio-define description: Comprehensive skills for working with valtio-define metadata: author: Hairyf version: "2025.01.29" source: Internal Documentation

Based on valtio-define v1.0.1. A Valtio-based state management library with Pinia-like API for React applications.

Overview

valtio-define provides a factory function for creating reactive stores with state, actions, and getters. Built on top of Valtio, it offers a familiar API similar to Pinia with full TypeScript support.

Core References

| Topic | Description | Reference | |-------|-------------|-----------| | defineStore | Core API for creating reactive stores | core-define-store | | useStore | React hook for accessing store state | core-use-store | | Types | TypeScript types and interfaces | core-types |

Advanced Features

| Topic | Description | Reference | |-------|-------------|-----------| | Subscriptions | Subscribe to state changes | advanced-subscribe | | Patch | Update state with patch operations | advanced-patch | | Signal | JSX component for inline reactive values | advanced-signal | | Store to State | Convert store to useState-like hooks | advanced-store-to-state |

Features

| Topic | Description | Reference | |-------|-------------|-----------| | Plugin System | Extend stores with plugins | feature-plugin-system | | Persistent Plugin | Persist state to storage | feature-persistent-plugin |

Quick Start

import { defineStore, useStore } from 'valtio-define'

const store = defineStore({
  state: () => ({ count: 0 }),
  actions: {
    increment() { this.count++ },
  },
  getters: {
    doubled() { return this.count * 2 },
  },
})

function Counter() {
  const state = useStore(store)
  return (
    <div>
      <div>Count: {state.count}</div>
      <div>Doubled: {state.doubled}</div>
      <button onClick={store.increment}>Increment</button>
    </div>
  )
}

forum用户评价 (0)

发表评价

效果
易用性
文档
兼容性

暂无评价,来写第一条吧

统计数据

安装量434
评分0.0 / 5.0
版本1.0.0
更新日期2026年3月16日
对比案例0 组

用户评分

0.0(0)
5
0%
4
0%
3
0%
2
0%
1
0%

为此 Skill 评分

0.0

兼容平台

🔧Claude Code

时间线

创建2026年3月16日
最后更新2026年3月16日