Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

onlystate

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

onlystate

A state and only state management library for Vue3

  • 0.0.7
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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 文件单独打包使用

Keywords

FAQs

Package last updated on 11 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc