(time: number)
| 192 | }; |
| 193 | |
| 194 | const shouldInvoke = (time: number) => { |
| 195 | if (!mounted.current) return false; |
| 196 | |
| 197 | const timeSinceLastCall = time - lastCallTime.current; |
| 198 | const timeSinceLastInvoke = time - lastInvokeTime.current; |
| 199 | |
| 200 | // Either this is the first call, activity has stopped and we're at the |
| 201 | // trailing edge, the system time has gone backwards and we're treating |
| 202 | // it as the trailing edge, or we've hit the `maxWait` limit. |
| 203 | return ( |
| 204 | !lastCallTime.current || |
| 205 | timeSinceLastCall >= wait || |
| 206 | timeSinceLastCall < 0 || |
| 207 | (maxing && timeSinceLastInvoke >= maxWait) |
| 208 | ); |
| 209 | }; |
| 210 | |
| 211 | const trailingEdge = (time: number) => { |
| 212 | timerId.current = null; |
no outgoing calls
no test coverage detected
searching dependent graphs…