UNPKG

rimmel

Version:

A Streams-Oriented UI library for the Rx.Observable Universe

21 lines (18 loc) 679 B
import { SINK_TAG } from '../constants.js'; const APPEND_HTML_SINK_TAG = 'appendHTML'; const AppendHTMLSink = (node) => node.insertAdjacentHTML.bind(node, 'beforeend'); /** * A specialised sink to append HTML to the end of an element * @param source A present or future HTML string * @returns RMLTemplateExpression An HTML-subtree or RML template expression * @example <div>${AppendHTML(stream)}</div> */ const AppendHTML = (source, pos = 'beforeend') => ({ type: SINK_TAG, t: APPEND_HTML_SINK_TAG, source, sink: AppendHTMLSink, params: pos, }); export { APPEND_HTML_SINK_TAG, AppendHTML, AppendHTMLSink }; //# sourceMappingURL=append-html-sink.js.map