[lib] Introduce allAtOnce param to useENSNames
Summary:
In D8248, I updated the code for useThreadSearchIndex to circumvent useENSNames so that we could make a single React state update for all of the ENS names instead of having a separate React state update for each name as it trickled in.
While investigating ENG-5274 I realized we need a more generic mechanism for this.
Additionally, in that case there is some separation in the callstack between the call to useENSNames and the business logic that needs resolved ENS names. As such, I figured the best solution would be to introduce a parameter to useENSNames that would achieve what we want, and can be "drilled" through the entire callstack.
In the following diff, I'll introduce a new usage of this new parameter to resolve ENG-5274.
Test Plan:
- I confirmed that I'm still able to search for an ENS name in the inbox search, and a matching chat is returned.
- I tested performance before and after this change using my production data to confirm I'm not introducing a regression.
Reviewers: tomek, atul
Reviewed By: tomek, atul
Subscribers: rohan, wyilio
Differential Revision: https://phab.comm.dev/D9515