Skip to content

Commit

Permalink
opa-react: use Object.assign() to combine batch results
Browse files Browse the repository at this point in the history
  • Loading branch information
srenatus committed Jul 12, 2024
1 parent 4ad7750 commit 2211df7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/opa-react/src/authz-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const evals = (sdk: OPAClient) =>
),
);
}),
).then((all: object[]) => all.reduce((acc, n) => ({ ...acc, ...n }), {})); // combine result arrays of objects
).then((all: object[]) => Object.assign({}, ...all)); // combine result arrays of objects
},
resolver: (results, query) => results[key(query)] ?? null,
scheduler: windowScheduler(10),
Expand Down

0 comments on commit 2211df7

Please sign in to comment.