UNPKG

rimmel

Version:

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

21 lines (18 loc) 696 B
import { SINK_TAG } from '../constants.js'; const PREPEND_HTML_SINK_TAG = 'prependHTML'; const PrependHTMLSink = (node) => node.insertAdjacentHTML.bind(node, 'afterbegin'); /** * A specialised sink to prepend HTML at the beginning of an element * @param source A present or future HTML string * @returns RMLTemplateExpression An HTML-subtree RML template expression * @example <div>${PrependHTML(stream)}</div> */ const PrependHTML = (source, pos = 'afterbegin') => ({ type: SINK_TAG, t: PREPEND_HTML_SINK_TAG, source, sink: PrependHTMLSink, params: pos, }); export { PREPEND_HTML_SINK_TAG, PrependHTML, PrependHTMLSink }; //# sourceMappingURL=prepend-html-sink.js.map