Skip to content

Commit c73bdaa

Browse files
committed
Remove unnecessary conditional
1 parent 4655605 commit c73bdaa

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/components/PlaceholderWithoutTracking.jsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,16 @@ class PlaceholderWithoutTracking extends React.Component {
77
constructor(props) {
88
super(props);
99

10-
if (!this.LAZY_LOAD_OBSERVER) {
11-
const supportsObserver = isIntersectionObserverAvailable();
10+
const supportsObserver = isIntersectionObserverAvailable();
1211

13-
this.LAZY_LOAD_OBSERVER = { supportsObserver };
12+
this.LAZY_LOAD_OBSERVER = { supportsObserver };
1413

15-
if (supportsObserver) {
16-
const { threshold } = props;
14+
if (supportsObserver) {
15+
const { threshold } = props;
1716

18-
this.LAZY_LOAD_OBSERVER.observer = new IntersectionObserver(
19-
this.checkIntersections, { rootMargin: threshold + 'px' }
20-
);
21-
}
17+
this.LAZY_LOAD_OBSERVER.observer = new IntersectionObserver(
18+
this.checkIntersections, { rootMargin: threshold + 'px' }
19+
);
2220
}
2321
}
2422

0 commit comments

Comments
 (0)