registry.js 457 B

1234567891011121314151617181920212223
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. var children = /*#__PURE__*/new Map();
  4. var sessionIdIndex = 0;
  5. var registry = {
  6. bookId: function () {
  7. return "x:".concat(sessionIdIndex++);
  8. },
  9. register: function (id, actor) {
  10. children.set(id, actor);
  11. return id;
  12. },
  13. get: function (id) {
  14. return children.get(id);
  15. },
  16. free: function (id) {
  17. children.delete(id);
  18. }
  19. };
  20. exports.registry = registry;