@the-/state

16.0.1 • Public • Published

@the-/state

npm Version

State holder for the-components

Installation

$ npm install @the-/state --save

Usage

'use strict'

const { TheState } = require('@the-/state')

async function tryExample() {
  const state = new TheState()

  const account = state.scope('account')
  state.subscribe(() => {
    // Handle change
    /* ... */
  })

  account.set({ name: 'John', password: 'xxxxx' })

  console.log(account.get('name')) // John
}

tryExample().catch((err) => console.error(err))

API Guide

See API Guide for more detail

License

This software is released under the MIT License.

Links

/@the-/state/

    Package Sidebar

    Install

    npm i @the-/state

    Weekly Downloads

    28

    Version

    16.0.1

    License

    MIT

    Unpacked Size

    103 kB

    Total Files

    39

    Last publish

    Collaborators

    • okunishinishi