Skip to content

Commit

Permalink
Merge pull request #3 from alexander-heimbuch/fix/mapstate-props
Browse files Browse the repository at this point in the history
fix(mapstate): Fixes mapstate on component binding
  • Loading branch information
alexander-heimbuch authored Oct 10, 2018
2 parents fcedee6 + 45e2120 commit 730552e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ export default {
name: 'My Vue Component',
data () {
return {
baz: 10
baz: 10,
...this.mapState({
baz: function (state) {
return state.bar + this.baz //maps state.bar + 10 to data.baz
foo: function (state) {
return state.bar + this.baz //maps state.bar + 10 to data.foo
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const connect = ({ Vue, store, actions = {} }) => {
this.store = store
this.$$actions = actions

this.mapState = (...props) => mapState(props).call(this)
this.mapState = (...props) => mapState(...props).call(this)
},
created () {
// Root component should not interact with the store
Expand Down

0 comments on commit 730552e

Please sign in to comment.