react-native-onyx
react-native-onyx copied to clipboard
Update the `multiSet` to update subscribers in a more optimized way
Problem
Currently, the way multiset works is that it notifies subscribers of any changes to the onyx keys in a loop:
https://github.com/Expensify/react-native-onyx/blob/f96fa2dc38b6abd1f99512af59647162fa11c88e/lib/Onyx.js#L985-L992
The performance of this can be improved in relation to collections, where we can see if all the keys are part of a collection, and if so - use keysChanged to update subscribers in a more optimized way.
Solution
Either:
- Update
multisetto support the above, or - Create a
setCollectionthat is optimized for collections
cc @marcaaron