Skip to content

Commit

Permalink
refactor: set keys in one loop
Browse files Browse the repository at this point in the history
  • Loading branch information
cngonzalez committed Mar 7, 2024
1 parent 11e76dd commit c56b911
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/sanity/src/core/store/key-value/backends/server.ts
Expand Up @@ -58,11 +58,12 @@ export function serverBackend({client: _client}: ServerBackendOptions): Backend
}),
).pipe(
map((response) => {
response.forEach((pair) => {
return response.map((pair) => {
keyValueLoader.clear(pair.key)
keyValueLoader.prime(pair.key, pair.value)

return pair.value
})
return response.map((pair) => pair.value)
}),
catchError((error) => {
console.error('Error setting data:', error)
Expand Down

0 comments on commit c56b911

Please sign in to comment.