Hey @thinhkhang97 馃憢馃徏
Thanks a lot for this library, this is really helpful.
I have reversed-engineered this library and found an infinite interval running even after getting the success callback.
I was wondering if we could implement a prop like runOnce?: boolean in the ViewPortDetector component.
In that way. Once we have an onChange call with true as a new value, we won't call the onChange callback again and we're gonna clear the setInterval.
What are your thoughts?
I'm about to raise a PR with this suggestion
Hey @thinhkhang97 馃憢馃徏
Thanks a lot for this library, this is really helpful.
I have reversed-engineered this library and found an infinite interval running even after getting the success callback.
I was wondering if we could implement a prop like
runOnce?: booleanin theViewPortDetectorcomponent.In that way. Once we have an
onChangecall withtrueas a new value, we won't call theonChangecallback again and we're gonna clear the setInterval.What are your thoughts?
I'm about to raise a PR with this suggestion