0.0.5 • Published 2 years ago

vue-recoil v0.0.5

Weekly downloads
1
License
MIT
Repository
github
Last release
2 years ago

vue-recoil · GitHub license

Recoil is an experimental set of utilities for state management with Vue 3.0.

Installation

The Recoil package lives in npm. To install the latest stable version, run the following command:

npm install --save vue-recoil

How to use

// `./store/atom.js`
import {atom} from 'vue-recoil';
export const atomState = atom({
  key: 'counter',
  default: 1,
});
// `.vue`
import {defineComponent} from 'vue';
import {useRecoilState} from 'vue-recoil';
import {atomState} from './store/atom';

export default defineComponent({
  setup() {
    let [count, setCount] = useRecoilState(atomState);
    const increment = () => {
      setCount(count + 1);
    };
    return {
      count,
      increment,
    };
  },
});

License

Recoil is MIT licensed.

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago

1.0.0

3 years ago