rimmel
Version:
A Stream-Oriented UI library for the Rx.Observable Universe
25 lines (22 loc) • 833 B
JavaScript
import { SINK_TAG } from '../constants.js';
const CHECKED_SINK_TAG = 'checked';
const CheckedSink = (node) => (checked) => {
node.checked = checked;
};
/**
* A specialised sink for the "checked" HTML attribute
* @param source A present or future boolean value
* @returns RMLTemplateExpression A template expression for the "checked" DOM attribute
* @example <input type="checkbox" checked="${booleanValue}">
* @example <input type="checkbox" checked="${booleanPromise}">
* @example <input type="checkbox" checked="${booleanObservable}">
* @example <input type="checkbox" checked="${Checked(booleanPromise)}">
*/
const Checked = (source) => ({
type: SINK_TAG,
t: CHECKED_SINK_TAG,
source,
sink: CheckedSink,
});
export { CHECKED_SINK_TAG, Checked, CheckedSink };
//# sourceMappingURL=checked-sink.js.map