0.4.1 • Published 4 years ago

vuex-typescript-fsa v0.4.1

Weekly downloads
295
License
MIT
Repository
-
Last release
4 years ago

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

0.4.1

4 years ago

0.4.0

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago