@peetertomberg/registry
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

registry

circleci lerna typescript

Basically a library to create a typed key-value store with an event emitter.

Install

npm install @peetertomberg/registry

Usage

Try on RunKit

  import { createRegistry } from '@peetertomberg/registry';
  
  const registry = createRegistry<String>();
  const callback = (...args) => console.log(...args);
  
  // Triggered when a key is registered
  registry.eventBus.on(registry.events.REGISTER, callback);
  // Triggered when a key is unregistered
  registry.eventBus.on(registry.events.UNREGISTER, callback);
  
  registry.register('key', 'value');
  registry.unregister('key');

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.30latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.30
1.0.20
1.0.00
1.0.10
0.0.00

Package Sidebar

Install

npm i @peetertomberg/registry

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

6.16 kB

Total Files

8

Last publish

Collaborators

  • peeter