1.0.0 • Published 4 years ago

@bastienrobert/state v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Install

npm install @bastienrobert/state

Usage

import StateManager from '@bastienrobert/state'

const state = new StateManager(['STATE1', 'STATE2', 'STATE3'])
state.add('STATE1')
state.remove('STATE1')
state.add(['STATE1', 'STATE2'])
state.remove(['STATE1', 'STATE2'])

state.has('STATE1')
state.has(['STATE1', 'STATE2'])

state.get()

API

See the Documentation.

Contributions

Inspired by https://gist.github.com/bloodyowl/5729489.