variable-manager
TypeScript icon, indicating that this package has built-in type declarations

1.2.10 • Public • Published

variable-manager

npm i variable-manager

import {VariableManager,Config} from "variable-manager";
let config = Config.Instance
Config.Instance.httpUrl = '/api'
Config.Instance.webSocket ='ws://192.168.18.31:8088/algmanager/ws'
let v = VariableManager.Instance

/**
	 * @description 初始化变量管理器
	 * @param parameter
	 * @param type 0,websocket直连 1,id 链接
	 * */
v.init({type:1,parameter:'2879100e-ad5f-4b0a-b82d-84709ffb3513'})
// initVariableList 在初始化前调用也可以在初始化后调用也可以
v.initVariableList([1, 2, 3, 4, 5, 6, 7, 8, 9], () => {
		console.log('123123132312')
	})
// 两种写法均可
v.setVariable({
    name: 'test',
    value:'testValue'
})
v.setVariable('test','testValue')

v.getVariable('test') // testValue 

Readme

Keywords

none

Package Sidebar

Install

npm i variable-manager

Weekly Downloads

6

Version

1.2.10

License

ISC

Unpacked Size

199 kB

Total Files

17

Last publish

Collaborators

  • fffqqq