rimmel
Version:
A Stream-Oriented UI library for the Rx.Observable Universe
21 lines (18 loc) • 560 B
JavaScript
import { SINK_TAG } from '../constants.js';
const TextContentSink = (node) => (str) => {
node.textContent = str;
};
/**
* A specialised sink to set the textContent on a node
* @param source A present or future string
* @returns RMLTemplateExpression A text-node RML template expression
* @example <div>${TextContent(stream)}</div>
*/
const TextContent = (source) => ({
type: SINK_TAG,
t: 'TextContent',
source: source,
sink: TextContentSink,
});
export { TextContent, TextContentSink };
//# sourceMappingURL=text-content-sink.js.map