UNPKG

@botonic/react

Version:

Build Chatbots using React

23 lines 691 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.NodeApp = void 0; 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({ renderer: args => this.renderNode(args), ...options, }); } async renderNode(args) { return (await 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