$
This commit is contained in:
16
node_modules/riot/esm/api/pure.js
generated
vendored
Normal file
16
node_modules/riot/esm/api/pure.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
/* Riot WIP, @license MIT */
|
||||
import { isFunction, panic, IS_PURE_SYMBOL } from '@riotjs/util';
|
||||
|
||||
/**
|
||||
* 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 };
|
Reference in New Issue
Block a user