registry
Basically a library to create a typed key-value store with an event emitter.
Install
npm install @peetertomberg/registry
Usage
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');