UNPKG

riot

Version:

Simple and elegant component-based UI library

19 lines (16 loc) 623 B
/* Riot v9.4.5, @license MIT */ import { isFunction } from '../dependencies/@riotjs/util/checks.js'; import { IS_PURE_SYMBOL } from '../dependencies/@riotjs/util/constants.js'; import { panic } from '../dependencies/@riotjs/util/misc.js'; /** * Lift a riot component Interface into a pure riot object * @param {Function} func - RiotPureComponent factory function * @returns {Function} the lifted original function received as argument */ function pure(func) { if (!isFunction(func)) panic('riot.pure accepts only arguments of type "function"'); func[IS_PURE_SYMBOL] = true; return func } export { pure };