vuex-watcher

0.1.3 • Public • Published

Vuex-Watcher

 Release Number License: 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

NPM Install

npm install vuex-watcher

Local Clone

$ git clone https://github.com/AndrewR3K/vuex-watcher.git vuex-watcher
 
$ cd vuex-watcher
$ npm install

Development

$ npm install
 
$ npm run dev

Usage

An in-depth example application can be found within /example folder of this repo.

General Usage

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'

{
  environment: <environment>
}

Watcher Types

State

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

Getters

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

Package Sidebar

Install

npm i vuex-watcher

Weekly Downloads

1

Version

0.1.3

License

MIT

Unpacked Size

10.5 kB

Total Files

9

Last publish

Collaborators

  • pandarew