vuex-typescript-fsa
TypeScript icon, indicating that this package has built-in type declarations

0.4.1 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i vuex-typescript-fsa

Weekly Downloads

178

Version

0.4.1

License

MIT

Unpacked Size

10.4 kB

Total Files

15

Last publish

Collaborators

  • sue71