UNPKG

@botonic/react

Version:

Build Chatbots using React

19 lines 643 B
import { __awaiter } from "tslib"; import { renderToStaticMarkup } from 'react-dom/server'; import { ReactBot } from './react-bot'; export class NodeApp { constructor(options) { this.bot = new ReactBot(Object.assign({ renderer: args => this.renderNode(args) }, options)); } renderNode(args) { return __awaiter(this, void 0, void 0, function* () { return (yield this.bot.renderReactActions(args)) .map(action => renderToStaticMarkup(action)) .join('\n'); }); } input(args) { return this.bot.input(args); } } //# sourceMappingURL=node-app.js.map