@botonic/react
Version:
Build Chatbots using React
23 lines • 792 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.NodeApp = void 0;
const tslib_1 = require("tslib");
const server_1 = require("react-dom/server");
const react_bot_1 = require("./react-bot");
class NodeApp {
constructor(options) {
this.bot = new react_bot_1.ReactBot(Object.assign({ renderer: args => this.renderNode(args) }, options));
}
renderNode(args) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
return (yield this.bot.renderReactActions(args))
.map(action => (0, server_1.renderToStaticMarkup)(action))
.join('\n');
});
}
input(args) {
return this.bot.input(args);
}
}
exports.NodeApp = NodeApp;
//# sourceMappingURL=node-app.js.map
;