private executeActions(itemIds: string[], eventChange: EventChangeEntity) {
return pipe(
[eventChange, itemIds],
retrieveItems, // [eventChange, Item]
// I want to skip invokeAction and updateItem effects if item.key is available
Effect.flatMap(([eventChange, items]) => {
return pipe(
Effect.forEachPar(items, invokeAction(eventChange)),
Effect.flatMap(Effect.forEachPar(updateItem(eventChange))),
Effect.map((items) => [eventChange, items] as EventItemAssociation)
);
})
// ... continued
);
}
private executeActions(itemIds: string[], eventChange: EventChangeEntity) {
return pipe(
[eventChange, itemIds],
retrieveItems, // [eventChange, Item]
// I want to skip invokeAction and updateItem effects if item.key is available
Effect.flatMap(([eventChange, items]) => {
return pipe(
Effect.forEachPar(items, invokeAction(eventChange)),
Effect.flatMap(Effect.forEachPar(updateItem(eventChange))),
Effect.map((items) => [eventChange, items] as EventItemAssociation)
);
})
// ... continued
);
}