UNPKG

vuestic-ui

Version:
20 lines (19 loc) 718 B
const isFunction = (val) => typeof val === "function"; const isObject = (val) => val !== null && typeof val === "object"; const useBindingProps = { rowBind: { type: null }, cellBind: { type: null } }; const useBinding = (props) => { const getRowBind = (row) => isFunction(props.rowBind) ? props.rowBind(row.source, row.initialIndex) : isObject(props.rowBind) ? props.rowBind : {}; const getCellBind = (cell, row) => isFunction(props.cellBind) ? props.cellBind(cell.source, row.source, cell.column, row.initialIndex) : isObject(props.cellBind) ? props.cellBind : {}; return { getRowBind, getCellBind }; }; export { useBinding as a, useBindingProps as u }; //# sourceMappingURL=useBinding.js.map