Skip to content

Questions: How to combine multiple UseCase? #111

Open
@rommansabbir

Description

@rommansabbir

Scenario:

  • I have 3 UseCase to perform 3 different API Request.
  • Based on the 3 UseCase response I need to combine them all according to the business logic.

Right now, I'm doing it by calling the 1st UseCase, then based on response, then another & so on.

So, how can I combine/zip them all in a single request or chain them one by one in a proper way?

Activity

pankajpy

pankajpy commented on May 20, 2021

@pankajpy
rommansabbir

rommansabbir commented on May 20, 2021

@rommansabbir
Author

@pankajpy actually, I'm talking about how to merge/combine multiple UseCase into one. Yes, I know how to merge multiple API calling using Coroutine but UseCase is missing in this scenario.

lrnrzg

lrnrzg commented on May 23, 2021

@lrnrzg
Contributor

Have a try to combine response in the Repository layer and then pass the Repository to a new UseCase.

rommansabbir

rommansabbir commented on May 26, 2021

@rommansabbir
Author

@ZhuSniffsTheRose Yes got your point. But the scenario is:

  • Have 3 Different Repository for Different Purpose
  • Have 3 Different Use Case for 3 Different Purpose

Now, I can call all required api one by one in a single use by adding their dependency, but I want to combine merge/combine multiple UseCase into one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Questions: How to combine multiple UseCase? · Issue #111 · android10/Android-CleanArchitecture-Kotlin