Open klis87 opened 8 months ago
Done in https://github.com/klis87/normy/releases/tag/%40normy%2Fcore%400.10.0 .
I will keep it open though, as unfortunately for now it does not work with rtk-query
. Awaiting https://github.com/reduxjs/redux-toolkit/issues/4073
Currently we always normalize data after each query successful response. However, some libs like react-query uses structural sharing feature, which preserves
data
reference if it did not change. We could use this to normy advantage to give up normalization in such cases, as normalizating in this scenario will end up with the same normalized store.This is especially useful for features like refetch on refocus, as then we can end up with multiple queries refetches at the same time, most of each will end up probably being the same.