vue-set-state

0.1.1 • Public • Published

vue-set-state

NPM version NPM downloads Build Status codecov donate

Bring React's setState greatness to Vue land, seriously? nope.

Install

yarn add vue-set-state

Usage

import setState from 'vue-set-state'

Vue.use(setState)

new Vue({
  data: { count: 0 },
  methods: {
    increment() {
      this.setState(prevState => ({
        count: prevState.count + 1
      }))
    }
  }
})

API

well, same as react's

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Development

# launch visual test
yarn dev 

# launch unit test
yarn test

Author

vue-set-state © egoist, Released under the MIT License.
Authored and maintained by egoist with help from contributors (list).

egoistian.com · GitHub @egoist · Twitter @rem_rin_rin

Readme

Keywords

none

Package Sidebar

Install

npm i vue-set-state

Weekly Downloads

7

Version

0.1.1

License

MIT

Last publish

Collaborators

  • rem