UNPKG

riot

Version:

Simple and elegant component-based UI library

20 lines (16 loc) 554 B
/* Riot v10.1.3, @license MIT */ import createRuntimeSlots from '../utils/create-runtime-slots.js'; import { component as component$1 } from '../api/component.js'; // wrap the original riot component function // to create the slots from the DOM node function component(implementation) { const factory = component$1(implementation); return (el, props, { slots, attributes, parentScope } = {}) => { return factory(el, props, { slots: slots || createRuntimeSlots(el), attributes, parentScope, }) } } export { component };