$
This commit is contained in:
26
node_modules/riot/esm/api/component.js
generated
vendored
Normal file
26
node_modules/riot/esm/api/component.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
/* Riot WIP, @license MIT */
|
||||
import compose from 'cumpa';
|
||||
import { createComponentFromWrapper } from '../core/create-component-from-wrapper.js';
|
||||
|
||||
/**
|
||||
* Helper method to create component without relying on the registered ones
|
||||
* @param {Object} implementation - component implementation
|
||||
* @returns {Function} function that will allow you to mount a riot component on a DOM node
|
||||
*/
|
||||
|
||||
function component(implementation) {
|
||||
return function (el, props, _temp) {
|
||||
let {
|
||||
slots,
|
||||
attributes,
|
||||
parentScope
|
||||
} = _temp === void 0 ? {} : _temp;
|
||||
return compose(c => c.mount(el, parentScope), c => c({
|
||||
props,
|
||||
slots,
|
||||
attributes
|
||||
}), createComponentFromWrapper)(implementation);
|
||||
};
|
||||
}
|
||||
|
||||
export { component };
|
Reference in New Issue
Block a user