UNPKG

riot

Version:

Simple and elegant component-based UI library

14 lines (11 loc) 422 B
/* Riot v10.1.2, @license MIT */ import { PLUGINS_SET } from '../dependencies/@riotjs/util/constants.js'; /** * Run the component instance through all the plugins set by the user * @param {object} component - component instance * @returns {object} the component enhanced by the plugins */ function runPlugins(component) { return [...PLUGINS_SET].reduce((c, fn) => fn(c) || c, component) } export { runPlugins };