# vuex-watcher

> A Vuex state watcher to empower Vue.js developers to easily utilize Vuex subscribers similar to vue's data prop watcher

Latest version **0.1.3** (published 2019-10-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install vuex-watcher
pnpm add vuex-watcher
yarn add vuex-watcher
bun add vuex-watcher
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2019-10-09 |
| First published | 2019-10-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | pandarew |
| Keywords | Vuex, vue, state, store, watcher, watch, listener |

## Links

- npm: https://www.npmjs.com/package/vuex-watcher
- Repository: https://github.com/andrewr3k/vuex-watcher
- Homepage: https://github.com/andrewr3k/vuex-watcher#readme
- Issues: https://github.com/andrewr3k/vuex-watcher/issues
- npm.io page: https://npm.io/package/vuex-watcher

## Alternatives

- [@reckona/mreact-store](https://npm.io/package/@reckona/mreact-store.md) — 976 weekly downloads
- [regular-state](https://npm.io/package/regular-state.md) — 410 weekly downloads
- [@pacote/flux-actions](https://npm.io/package/@pacote/flux-actions.md) — 65 weekly downloads
- [@pilotlab/lux-debug](https://npm.io/package/@pilotlab/lux-debug.md) — 39 weekly downloads
- [vue-persist-state](https://npm.io/package/vue-persist-state.md) — 19 weekly downloads

## Recent versions

- 0.1.3 (latest) — 2019-10-09
- 0.1.2 — 2019-10-07
- 0.1.1 — 2019-10-07
- 0.1.0 — 2019-10-07

## README

# Vuex-Watcher
![ ![Release Number]()](https://img.shields.io/badge/Release-0.1.3-%233fbced.svg)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

> Vue-Watcher was created to empower Vue.js developers to easily utilize Vuex subscribers similalr to vue's data prop watcher 

_This is compatible with Vue 2.*_

> This is an Alpha build, use at your own risk

## Table of Contents

-  [Install](#install)

-  [Usage](#usage)

-  [Build Setup](#build)


## NPM Install

``` bash
npm install vuex-watcher
```

### Local Clone

``` bash
$ git clone https://github.com/AndrewR3K/vuex-watcher.git vuex-watcher

$ cd vuex-watcher
$ npm install
```

### Development

```bash
$ npm install

$ npm run dev
```

## Usage
_An in-depth example application can be found within /example folder of this repo._

### General Usage
```javascript
import VueWatcher from 'vuex-watcher';
const myVueWatcher = new VueWatcher({
  environment: 'development',
  watches: [
    {
      getter: 'getactive',
      cb: (val) => console.log(`Running getters' "getMsg" callback => ${val}`)
    }
  ]
})

export default new Vuex.Store({
  plugins: [myVueWatcher]
})
```

### Environment
It is recommended to set the environment to "production" when running in a production state.

Options: 'development', 'production'

```javascript
{
  environment: <environment>
}
```

### Watcher Types

#### State
```javascript
{
  watches: [
    {
      state: 'text',
      cb: (val) => console.log(`Running state "text" callback => ${val}`)
    }
  ]
}
```

#### Getters
```javascript
{
  watches: [
    {
      getter: 'getactive',
      cb: (val) => console.log(`Running getters "getMsg" callback => ${val}`)
    }
  ]
}
```

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