Effect CommunityEC
Effect Communityβ€’3y agoβ€’
8 replies
Austin

Merging results of calls

Hello, hello! Quick lightweight question if anyone has a moment.

I have the following program

  const program = pipe(
    userServiceDb.getUsersFromDb,
    Effect.flatMap((u) =>
      herokuDb.getAvatarForUsersByContactSfids(u.map((u) => u.contact_sfid))
    )
    // Effect.flatMap((u) => sb.upsertUser(u))
  );


I need to merge the results of the userServiceDb and the herokuDb calls to use in sb.upsertUser. I can't quite figure it out, but I'm thinking I need to use a variation of zip
Was this page helpful?