# vuex-connect-namespace-helper

> namespaced module helper for vuex-connect

Latest version **1.1.0** (published 2018-07-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install vuex-connect-namespace-helper
pnpm add vuex-connect-namespace-helper
yarn add vuex-connect-namespace-helper
bun add vuex-connect-namespace-helper
```

## 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.0 |
| Published | 2018-07-12 |
| First published | 2018-07-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | nakajmg |
| Maintainers | nakajmg |
| Keywords | vue, vuex, vuex-connect, connect |

## Links

- npm: https://www.npmjs.com/package/vuex-connect-namespace-helper
- Repository: https://github.com/nakajmg/vuex-connect-namespace-helper
- Homepage: https://github.com/nakajmg/vuex-connect-namespace-helper#readme
- Issues: https://github.com/nakajmg/vuex-connect-namespace-helper/issues
- npm.io page: https://npm.io/package/vuex-connect-namespace-helper

## Recent versions

- 1.1.0 (latest) — 2018-07-12
- 1.0.1 — 2018-07-11
- 1.0.0 — 2018-07-11

## README

# vuex-connect-namespace-helper

[![npm version](https://badge.fury.io/js/vuex-connect-namespace-helper.svg)](https://badge.fury.io/js/vuex-connect-namespace-helper)
[![Build Status](https://travis-ci.org/nakajmg/vuex-connect-namespace-helper.svg?branch=master)](https://travis-ci.org/nakajmg/vuex-connect-namespace-helper)

A binding namespaced module helper for vuex-connect.

## Example

```js
const store = new Vuex.Store({
  state: {
    foo: 'foo',
  },
  modules: {
    moduleName: {
      namespaced: true,
      state: {
        bar: 'bar',
      },
      mutations: {
        barMutation(state, payload) {
          state.bar = payload
        },
      },
      actions: {
        barAction({ commit }, payload) {
          commit('barMutation', payload)
        },
      },
      getters: {
        barbar: state => state.bar + state.bar,
      },
    },
  },
})
```

```js
import { connect } from 'vuex-connect'
import {
  stateToProps,
  gettersToProps,
  mutationsToEvents,
  mutationsToProps,
  actionsToEvents,
  actionsToProps,
} from 'vuex-connect-namespace-helper'
import MyComponent from './MyComponent'

export default connect({
  stateToProps: {
    foo: 'foo',
    ...stateToProps('moduleName', {
      bar: 'bar',
    }),
  },
  gettersToProps: gettersToProps('moduleName', {
    barbar: 'barbar',
  }),
  mutationsToProps: mutationsToProps('moduleName', {
    testMutation: 'barMutation',
  }),
  mutationsToEvents: mutationsToEvents('moduleName', {
    testMutationEvent: 'barMutation',
  }),
  actionsToProps: actionsToProps('moduleName', {
    testAction: 'barAction',
  }),
  actionsToEvents: actionsToEvents('moduleName', {
    testActionEvent: 'barAction',
  }),
})(MyComponent)
```

## API

`helperFunction(namespace, options) -> Object`

- `stateToProps`
- `gettersToProps`
- `mutationsToEvents`
- `mutationsToProps`
- `actionsToEvents`
- `actionsToProps`

---
_Source: https://npm.io/package/vuex-connect-namespace-helper · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
