vuex-typescript-fsa

The helper which makes vuex more type-safety
7,911
Install
npm install vuex-typescript-fsa
Latest Version:0.4.1
Vue:2
License:MIT
Last Updated:Mar 29, 2020
Links: npm
Maintainer: sue71

vuex-typescript-fsa

The helper function for inferring a combination of action/mutation and handler

This project is under development. Some features have bugs and some APIs might be changed near future.

Installation

npm install vuex-typescript-fsa

Demo

demo

Usage

const Increment = actionCreator<number>("Increment");

const store = new Store<{ count: number }>({
  state: {
    count: 0
  },
  actions: combineAction(
    action(Increment, function(context, action) {
      context.commit(action);
    })
  ),
  mutations: combineMutation(
    mutation(Increment, function(state, action) {
      state.count = action.payload;
    })
  )
});

store.dispatch(Increment(10));

License

MIT

Related Packages

spyfu-vuex-helpers

Utility functions for Vuex.

2,459 9
vuex-pathify

Ridiculously simple Vuex setup + wiring

322,817 1,358
direct-vuex

Use and implement your Vuex store with TypeScript types. Compatible with the Vue...

90,286 255
undo-redo-vuex

A Vuex plugin for module namespaced undo and redo functionality. This plugin tak...

9,207 47
vuex-typing

Type helpers for vuex.

6,569 2

Version History

Version Released Vue License
0.4.1 2.6.11 MIT
0.4.0 2.5.21 MIT
0.3.0 ^2.5.21 MIT
0.2.0 ^2.5.21 MIT
0.1.1 ^2.5.21 MIT