Skip to content

Commit

Permalink
Code style refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilianoSanchez committed Dec 18, 2023
1 parent f241264 commit bf76689
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/asyncActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,13 @@ export function initSplitSdk(params: IInitSplitSdkParams): (dispatch: Dispatch<A
*/
function __getTreatments(client: IClientNotDetached, evalParams: IGetTreatmentsParams[]): SplitIO.TreatmentsWithConfig {
return evalParams.reduce((acc, params) => {
return params.splitNames ?
{ ...acc, ...client.getTreatmentsWithConfig(params.splitNames as string[], params.attributes) } :
{ ...acc, ...client.getTreatmentsWithConfigByFlagSets(params.flagSets as string[], params.attributes) };
return {
...acc,
...(params.splitNames ?
client.getTreatmentsWithConfig(params.splitNames as string[], params.attributes) :
client.getTreatmentsWithConfigByFlagSets(params.flagSets as string[], params.attributes)
)
};
}, {});
}

Expand Down

0 comments on commit bf76689

Please sign in to comment.