@e-group/utils
Version:
eGroup team utils that share across projects.
19 lines (17 loc) • 379 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = mergeRefs;
function mergeRefs(refs) {
return value => {
refs.forEach(ref => {
if (typeof ref === 'function') {
ref(value);
} else if (ref != null) {
// eslint-disable-next-line no-param-reassign
ref.current = value;
}
});
};
}