psmb/registry
Composer 安装命令:
composer require psmb/registry
包简介
Global registry of things with an Eel helper
README 文档
README
Use with caution and only if you absolutely have to!
This package provides you with a registry service and an Eel helper to get and set values on it.
Installation
composer require psmb/registry
Usage
Example
root = T:Collection {
@context.blah = ${Registry.set('acc', 0)}
collection = ${[1,2,3]}
itemName = 'item'
itemRenderer = T:Value {
@context.blah = ${Registry.set('acc', item + Registry.get('acc'))}
value = ${Registry.get('acc')}
}
}
The following methods are available:
- set(key, value): Sets a value by key
- get(key): Returns a value by key
- getset(key, value): Atomically sets key to value and returns the old value stored at key.
- increment(key): Increment a value by key
- decrement(key): Derement a value by key
A key can consist of a single string or a path, separated with dots which addresses a value in a nested array.
统计信息
- 总下载量: 27.46k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-11-29