slevisp

solidjs-state

slevisp

A tiny SolidJS state helper that unifies createSignal and createStore behind one createState API with typed selectors.

AI 简介

solidjs-state 是一个轻量级的 SolidJS 状态管理辅助库,通过统一的 createState API 封装了 createSignal 和 createStore,并支持类型化的选择器。其核心功能在于根据初始值自动选择使用信号或存储来创建状态,并提供一致的状态读取方式 `state()`,同时允许开发者定义选择器以实现更复杂的派生状态计算。此项目特别适用于需要简化状态管理和提高代码可维护性的 SolidJS 项目中。它不引入额外的运行时依赖,仅作为 solid-js 的对等依赖存在,确保了应用性能和包体积控制。

TypeScript
MIT License 最后更新 2026年5月24日活跃
107
Stars
5
Forks
3
Watchers
0
Issues

Star 增长

今日0
近 7 天+37
近 30 天+85
综合评分69.33
默认分支main