1.0.12 • Published 5 years ago

the-state v1.0.12

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

the-state

Build Status npm Version JS Standard

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(({ account }) => {
    // Handle change
    /* ... */
  })

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

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

}

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

API Guide

License

This software is released under the MIT License.

Links

1.0.12

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago