registry.js 370 B

12345678910111213141516171819
  1. var children = /*#__PURE__*/new Map();
  2. var sessionIdIndex = 0;
  3. var registry = {
  4. bookId: function () {
  5. return "x:".concat(sessionIdIndex++);
  6. },
  7. register: function (id, actor) {
  8. children.set(id, actor);
  9. return id;
  10. },
  11. get: function (id) {
  12. return children.get(id);
  13. },
  14. free: function (id) {
  15. children.delete(id);
  16. }
  17. };
  18. export { registry };