use-state-vue-sm
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

use-state-vue

Simple replica of React useState() for Vue 3.

Install

npm install use-state-vue

Usage

import useState from 'use-state-vue';

const [count, setCount] = useState(0);
setCount(count + 1);

Idea behind this library

This library tries to replicate the useState() hook present in React.

The equivalent in Vue 3 is something like:

import { ref } from 'vue';

const count = ref(0);
const increment = () => {
  count.value += 1;
};

Package Sidebar

Install

npm i use-state-vue-sm

Weekly Downloads

7

Version

0.0.4

License

MIT

Unpacked Size

3.15 kB

Total Files

5

Last publish

Collaborators

  • smontiel