Skip to content
Discussion options

You must be logged in to vote

One way to solve it is to rely on some external container data type as you did.

Another way is to create a data class to hold the values for the call to .getPromos() and myCustomer, so in the next step you have access to both (e.g., MyClass(List<CustomerProfiles>, CustomerProfile)).

There are also times where you can use a nested flatMap / concatMap / transformToUni so you can keep a value in scope, as in:

Uni.createFrom().item(123)
        .flatMap(base -> Uni.createFrom().item(List.of(base, base + 1, base + 2))
                .map(list -> Uni.createFrom().item(base + " -> " + list)))
        .subscribe().with(System.out::println);

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Stwissel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants