this repo has no description
1"use strict"; 2Object.defineProperty(exports, "__esModule", { value: true }); 3exports.LegacyRuntime = exports.Runtime = void 0; 4const isJetEnvironment = typeof exportService === "function"; 5function nativeExportService(name, service) { 6 exportService(name, service); 7} 8class Runtime { 9 constructor(dispatcher, objectGraph) { 10 this.dispatcher = dispatcher; 11 this.objectGraph = objectGraph; 12 } 13 async dispatch(intent) { 14 return await this.dispatcher.dispatch(intent, this.objectGraph); 15 } 16} 17exports.Runtime = Runtime; 18class LegacyRuntime extends Runtime { 19 constructor(dispatcher, objectGraph, services) { 20 super(dispatcher, objectGraph); 21 this.services = services; 22 } 23 serviceWithName(name) { 24 return this.services[name]; 25 } 26 exportingService(name, service) { 27 if (isJetEnvironment) { 28 nativeExportService(name, service); 29 } 30 this.services[name] = service; 31 return this; 32 } 33} 34exports.LegacyRuntime = LegacyRuntime; 35//# sourceMappingURL=runtime.js.map