redux-store-mixin
Mixin for integrate action creators in methods of vue component
Last updated 2 years ago by kolesoffac .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install redux-store-mixin 
SYNC missed versions from official npm registry.

redux-store-mixin

NPM

npm version npm downloads

Mixin for integrate action creators in methods of vue component

Install

npm install --save redux-store-mixin

Usage

1. Import mixin

import reduxStoreMixin from "redux-store-mixin";

2. Import our actionCreators

import {actionCreators} from "store/store";

3. Import mapState-method for useful connect with props from redux-store

import { mapState } from "vuex";

4. Create vue instance

new Vue({
  mixins: [
                ...
		reduxStoreMixin(actionCreators),
                ...
  ],
  computed: {
		...mapState({
			prop1: state => state.redux.map.prop1,
      ...
      propN: state => state.redux.map.propN
    }),
    ...
  },
  ...
});

Example

Call action:

...
methods: {
  someMethod: function () {
    this.reduxActions("actionName", [...argsForAction]);
  }
},
...

For more information see

Current Tags

  • 1.0.6                                ...           latest (2 years ago)

3 Versions

  • 1.0.6                                ...           2 years ago
  • 1.0.5                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |