1.2.0 • Published 6 years ago
toggle-state v1.2.0
toggle-state
Toggle state.
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