# @shimochi/vuex-map-state-two-way

> vuex-map-state-two-way

Latest version **1.1.1** (published 2019-03-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install @shimochi/vuex-map-state-two-way
pnpm add @shimochi/vuex-map-state-two-way
yarn add @shimochi/vuex-map-state-two-way
bun add @shimochi/vuex-map-state-two-way
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2019-03-01 |
| First published | 2019-03-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | shimochi |
| Maintainers | shimochi |

## Links

- npm: https://www.npmjs.com/package/@shimochi/vuex-map-state-two-way
- Repository: https://github.com/shimochi/vuex-map-state-two-way
- Homepage: https://github.com/shimochi/vuex-map-state-two-way#readme
- Issues: https://github.com/shimochi/vuex-map-state-two-way/issues
- npm.io page: https://npm.io/package/@shimochi/vuex-map-state-two-way

## Recent versions

- 1.1.1 (latest) — 2019-03-01
- 1.1.0 — 2019-03-01
- 1.0.2 — 2019-03-01
- 1.0.1 — 2019-03-01
- 1.0.0 — 2019-03-01

## README

# vuex-map-state-two-way

## Installation
```
$ npm install @shimochi/vuex-map-state-two-way --save
```

## Usage
```javascript
<template>
  <form>
    <input v-model="name">
    <input v-model="email">
  </form>
</template>

<script>
import { mapStateTwoWay } from 'vuex-map-state-two-way';

export default {
  computed: {
    ...mapStateTwoWay('user', ['name', 'email'])
  }
}
</script>
```

```javascript
export default {
  namespaced: true,
  state: {
    name: null,
    email: null
  },
  getters: {
    name: state => state.name,
    email: state => state.email
  },
  mutations: {
    name (state, name) {
      state.name = name
    },
    email (state, email) {
      state.email = email
    }
  },
  actions: {
    setName ({ commit }, value) {
      commit('name', value)
    },
    setEmail ({ commit }, value) {
      commit('email', value)
    }
  }
}
```

## License
The vuex-map-state-two-way is open source software licensed under the [MIT license](LICENSE).

---
_Source: https://npm.io/package/@shimochi/vuex-map-state-two-way · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
