()
| 104 | } |
| 105 | |
| 106 | observeNode() { |
| 107 | if (!this.node || this.props.skip) return; |
| 108 | const { |
| 109 | threshold, |
| 110 | root, |
| 111 | rootMargin, |
| 112 | trackVisibility, |
| 113 | delay, |
| 114 | fallbackInView, |
| 115 | } = this.props; |
| 116 | |
| 117 | if (this.lastInView === undefined) { |
| 118 | this.lastInView = this.props.initialInView; |
| 119 | } |
| 120 | this._unobserveCb = observe( |
| 121 | this.node, |
| 122 | this.handleChange, |
| 123 | { |
| 124 | threshold, |
| 125 | root, |
| 126 | rootMargin, |
| 127 | // @ts-expect-error |
| 128 | trackVisibility, |
| 129 | delay, |
| 130 | }, |
| 131 | fallbackInView, |
| 132 | ); |
| 133 | } |
| 134 | |
| 135 | unobserve() { |
| 136 | if (this._unobserveCb) { |
no test coverage detected