SecondaryCacheLoader.fetchObjectsFromDatabaseAsync should return sparse map
wschurman opened this issue · 0 comments
wschurman commented
Context: https://github.com/expo/universe/pull/7641/files/90dc1071ada997f57c0b8d33b7b0e7d7e5fe2b15#r641291143
Looking at this PR, I wonder if
EntitySecondaryCacheLoader
should allow this method to return "sparse" maps that are missing some of the provided keys. A missing key would mean the object was missing from the database and be treated the same way asnull
orundefined
. This way, implementers offetchObjectsFromDatabaseAsync
wouldn't need to pad maps withnull
entries like this.
EntitySecondaryCacheLoader
would then fill innull
for all of the missing keys so that the caller of the loader still gets a map with every single key in it, potentially withnull
values.