@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');

Readme

Keywords

none

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