Closed vindennt closed 1 year ago
observed to sometimes run more than twice, suggesting slow asyncs arriving all at once are causing rerenders, which recall the functions to getRewards again and again. Solution: try useMemo and useCallback to avoid recalling the function
no longer issue after redux refactorization
console logging for most methods runs twice, which means everything runs twice and is a waste of performance. Worth noting that tripRewardHandler always logs a reward of 0, suggesting the sequence runs first with an empty trip list until findViableTrips() finishes. Potential fix would be for downstream methods to not be called until findViableTrips() finishes?