1nwf / Produx-v2

Avoid using promises in places not designed to handle them JS-0336
Anti-pattern
Major
8 months ago8 months old
Promise returned in function argument where a void return was expected
 36        (node) => {
 37            if (commentsReqInfo.isLoading) return
 38            if (observer.current) observer.current.disconnect()
 39            observer.current = new IntersectionObserver(async (entries) => { 40                if (entries[0].isIntersecting && hasMore) { 41                    await getComments({ 42                        postId: parseInt(postId as string), 43                        lastId: lastId, 44                    }) 45                } 46            }) 47            if (node) observer.current.observe(node)
 48        },
 49        [commentsReqInfo.isLoading, hasMore]