UNPKG
nishant-design-system
Version:
latest (0.1.26)
0.2.2
0.2.1
0.2.0
0.1.26
0.1.25
0.1.20
0.1.16
0.1.15
0.1.9
0.1.8
0.1.7
0.1.6
0.1.5
0.1.3
0.1.2
0.1.1
0.1.0
0.0.9
0.0.8
0.0.7
0.0.5
0.0.4
0.0.2
0.0.1
0.0.0
Sense UI components library
spaced-out.github.io/ui-design-system
spaced-out/ui-design-system
nishant-design-system
/
lib
/
utils
/
merge-refs.js.flow
15 lines
(14 loc)
•
309 B
Flow
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// @flow strict
export
function
mergeRefs
(
refs:
Array
<{current: ?HTMLElement, ...}>,
):
(
value: empty
) =>
void
{
return
(
value
) =>
{ refs.
forEach
(
(
ref
) =>
{
if
(
typeof
ref ===
'function'
) {
ref
(value); }
else
if
(ref !=
null
) { ref.
current
= value; } }); }; }