@rsc-labs/nocto-plugin-system
Version:
Pluggable registry system for Nocto plugins
16 lines (15 loc) • 371 B
JavaScript
class SlotRegistryClass {
constructor() {
this.slots = [];
}
register(contribution) {
this.slots.push(contribution);
}
get(pluginId, slot) {
return this.slots.filter((c) => c.pluginId === pluginId && c.slot === slot);
}
getAll() {
return this.slots;
}
}
export const SlotRegistry = new SlotRegistryClass();