0.0.13 • Published 2 years ago

onlystate v0.0.13

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

onlystate

一个仅关注state的状态库, 基于vue3-reactive模块实现, 并且提供vue-devtools插件

特点

  • 关注于State,去掉了action,你可以通过compositionAPI来时实现action

使用

npm install onlystate --save-dev 1. 定义state

//store.js
import {defineState} from 'onlystate';
const install = defineState({
    a: 1,
    b: 2
}, {
    c: state => 'a=' + state.a,
    d: state => 'b=' + state.b
});
export default install;
  1. 注册state
import Astate from './store'
//main.js
app = createApp(App);
app.use(Astate);
  1. 基本使用
<script setup>
import {useState} from 'onlystate';
    const [a, b] = useState('a', 'b');
    a.value = 2;
</script>

TODO

  • 基本功能
  • rollup打包umd、cjs、esm
  • vue devtools 文件单独打包使用
0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago