1.0.2 • Published 4 years ago

@agmajs/store v1.0.2

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

@agmajs/store

State management for @agmajs/script.

Installation

Using NPM:

$ npm install @agmajs/store

Using Yarn:

$ yarn add @agmajs/store

Usage

Creating the Store

It's best to create a separate folder called store and have an index.js in there with the following code.

// store/index.js
const { createStore } = require("@agmajs/store");

module.exports = createStore('nameOfTheLocalStorage', {
  // Your default store state here...
});

Using the Store

// commands/test.js
const { defineCommand } = require("@agmajs/script");

const store = require('../store');

module.exports = defineCommand({
  name: "test",
  run: (script, chatCtx, args) => {
    store.state.test = false;
  }
});
1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago