• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

SAP / ui5-webcomponents-react / 9695229913

27 Jun 2024 10:49AM CUT coverage: 33.288% (-48.1%) from 81.421%
9695229913

Pull #5984

github

web-flow
Merge ffa7cbff1 into ef490f487
Pull Request #5984: refactor(enrichEventWithDetails): pass through `detail`, improve types

665 of 3841 branches covered (17.31%)

10 of 11 new or added lines in 2 files covered. (90.91%)

2848 existing lines in 100 files now uncovered.

1968 of 5912 relevant lines covered (33.29%)

179.02 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.89
/packages/base/src/hooks/useSyncRef.ts
1
'use client';
2

3
import type { MutableRefObject, Ref, RefCallback } from 'react';
4
import { useCallback, useRef } from 'react';
5

6
export function useSyncRef<RefType = never>(
7
  ref: Ref<RefType>
8
): [RefCallback<RefType>, MutableRefObject<RefType | null>] {
9
  const localRef = useRef<RefType | null>(null);
757✔
10

11
  const componentRef = useCallback(
757✔
12
    (node) => {
13
      if (ref) {
1,215✔
14
        if (typeof ref === 'function') {
4!
UNCOV
15
          ref(node);
×
16
        }
17
        if ({}.hasOwnProperty.call(ref, 'current')) {
4✔
18
          (ref as MutableRefObject<RefType>).current = node;
4✔
19
        }
20
      }
21
      localRef.current = node;
1,215✔
22
    },
23
    [ref]
24
  );
25

26
  return [componentRef, localRef];
757✔
27
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc