1.2.0 • Published 6 years ago

toggle-state v1.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

toggle-state

Toggle state.

Travis Codecov License NPM Version NPM Downloads

Installation

Using Yarn:

$ yarn add toggle-state

Using npm:

$ npm install toggle-state

Usage

import { toggle, togglify } from 'toggle-state'

const state = false
toggle(state, true, false)  //=> true

const switcher = togglify(state, true, false)
switcher()  //=> true
switcher()  //=> false

License

MIT License

Copyright (c) 2018-present Pig Fang