react-raw-html
Version:
React components that output their children as raw HTML.
27 lines (21 loc) • 572 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _stream = require("stream");
var _stream2 = _interopRequireDefault(_stream);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// turns a string into a Readable stream.
exports.default = function (input) {
var output = new _stream2.default.Readable();
var pushed = false;
output._read = function (n) {
if (pushed) {
this.push(null);
} else {
pushed = true;
this.push(input);
}
};
return output;
};