Skip to content

joenix/vuex-fast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Sep 19, 2023
430111e · Sep 19, 2023

History

13 Commits
Sep 19, 2023
Mar 16, 2023
Oct 31, 2021
Sep 19, 2023
Oct 31, 2021
Oct 31, 2021
Sep 19, 2023
Jan 11, 2022
Mar 10, 2023

Repository files navigation

vue-fast

a simple library for use vuex easily

yarn add vuex-fast

init in vue2

import vuexFast from 'vuex-fast';

const modules = vuexFast({
  a: moduleA,
  b: moduleB,
});

const store = new Vuex.Store({ modules });

init in vue3

import vuexFast from 'vuex-fast';

import { createStore } from 'vuex';

const modules = vuexFast({
  a: moduleA,
  b: moduleB,
});

const store = createStore({ modules });

use

// State
numeric: {
  a: 100,
  b: 200
}

// Action
calculate({ state }) {
  return {
    numeric: {
      a: state.a,
      b: state.a + state.b
    }
  }
}

// Use
this.$store.dispatch('calculate');
console.log(this.$store.state.numeric); // { a: 100, b: 300 }

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published