Akryum / vue-observe-visibility

Detect when an element is becoming visible or hidden on the page.
https://jsfiddle.net/Akryum/ppt7endj/
1.65k stars 87 forks source link

Simplify threshold type check #239

Closed dhritzkiv closed 3 years ago

dhritzkiv commented 3 years ago

Simplify threshold type check: the typeof this.options.intersection.threshold === 'number' check already covers the intent of the this.options.intersection check

Akryum commented 3 years ago

If this.options.intersection is nullish it will throw a TypeError.

dhritzkiv commented 3 years ago

Right, of course! Sorry - I misread the line of code. I've been writing too much optional chaining code! 😅