0.1.3 • Published 2 years ago

@stormzx/context v0.1.3

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Description

This is a simple context library.

Node.js 16.0 or higher is required.

Installation

Installation is done using the npm install command:

$ npm install @stormzx/context

Examples:

const {Context} = require('@stormzx/context')

// set something on global context
Context.set('arg', 'at global')
// or
Context.rootStore.set('arg2', 'arg2 at global')

Context.run({arg: 'at context'}, () => {
  console.log(Context.get('arg')); // at contxt

  console.log(Context.get('arg2')); // arg2 at global

  Context.run({arg: 'at context 2'}, () => {
    console.log(Context.get('arg')); // at contxt 2
  })
})

console.log(Context.get('arg')); // at global
0.1.2

2 years ago

0.1.3

2 years ago

0.1.0

2 years ago

0.1.1

2 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago