riot
Version:
Simple and elegant component-based UI library
14 lines (11 loc) • 516 B
JavaScript
/* Riot v10.1.2, @license MIT */
import { DOM_COMPONENT_INSTANCE_PROPERTY } from '../dependencies/@riotjs/util/constants.js';
/**
* Bind a DOM node to its component object
* @param {HTMLElement} node - html node mounted
* @param {object} component - Riot.js component object
* @returns {object} the component object received as second argument
*/
const bindDOMNodeToComponentInstance = (node, component) =>
(node[DOM_COMPONENT_INSTANCE_PROPERTY] = component);
export { bindDOMNodeToComponentInstance };