@bastienrobert/state
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

State

State management for all engines

Very fast cross-platform state management using bitwise operators.
Fast & 374B gzipped (because size matters)

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.

Dependencies (0)

    Dev Dependencies (13)

    Package Sidebar

    Install

    npm i @bastienrobert/state

    Weekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    10.4 kB

    Total Files

    7

    Last publish

    Collaborators

    • bastienrobert