Expensify / react-native-onyx

Persistent, offline-first state management solution for React Native. Easy to use with minimal config and boilerplate.
MIT License
160 stars 73 forks source link

perf: use ForEach method from Set instead of manual loop operations #550

Closed hurali97 closed 4 months ago

hurali97 commented 5 months ago

Details

This is a follow-up PR of https://github.com/Expensify/react-native-onyx/pull/546. It uses the ForEach method from Set instead of manually converting it to an Array, then filtering it and later reducing it. We can do the 3 loops job in one using the approach in this PR.

Related Issues

N/A - follow up PR of https://github.com/Expensify/react-native-onyx/pull/546

Automated Tests

Manual Tests

Author Checklist

Screenshots/Videos

Android: Native https://github.com/Expensify/react-native-onyx/assets/47336142/0871bcf3-de84-469c-9fa5-19fde1754dfa
Android: mWeb Chrome https://github.com/Expensify/react-native-onyx/assets/47336142/0ba25859-9763-4d94-a9d7-37726bbea0b3
iOS: Native https://github.com/Expensify/react-native-onyx/assets/47336142/b222bd35-694a-4cf8-9b47-27d59943e657
iOS: mWeb Safari https://github.com/Expensify/react-native-onyx/assets/47336142/aeaf0ec9-5cfa-46fa-9386-31ff8f1675ff
MacOS: Chrome / Safari https://github.com/Expensify/react-native-onyx/assets/47336142/9fa4820d-bcdb-40ec-b236-06db8e99b754
MacOS: Desktop https://github.com/Expensify/react-native-onyx/assets/47336142/b40107cb-58d6-4d7e-b5f3-75fa1f9284c8
github-actions[bot] commented 4 months ago

🚀Published to npm in v2.0.51