You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
Object.defineProperty(exports, "__esModule", { value: true }); exports.getQueriesForElement = getQueriesForElement;
var defaultQueries = _interopRequireWildcard(require("./queries"));
/** * @typedef {{[key: string]: Function}} FuncMap */
/** * @param {HTMLElement} element container * @param {FuncMap} queries object of functions * @param {Object} initialValue for reducer * @returns {FuncMap} returns object of functions bound to container */ function getQueriesForElement(element, queries = defaultQueries, initialValue = {}) { return Object.keys(queries).reduce((helpers, key) => { const fn = queries[key]; helpers[key] = fn.bind(null, element); return helpers; }, initialValue); }
|