Skip to content

Example in readme gives me compilation error #6479

@cvgaviao

Description

@cvgaviao

I'm trying the examples provided in the readme file and in specifically this one I got a compilation error in the map() method (Cannot return a void result) :

Flowable<Inventory> inventorySource = warehouse.getInventoryAsync();

inventorySource.flatMap(inventoryItem ->
    erp.getDemandAsync(inventoryItem.getId())
    .map(demand 
        -> System.out.println("Item " + inventoryItem.getName() + " has demand " + demand));
  )
  .subscribe();

It should be something like this, isn't?:

        inventorySource
                .flatMap(inventoryItem -> demandService
                        .getDemandAsync(inventoryItem.getId())
                        .map(demand -> "Item " + inventoryItem.getName()
                                + " has demand " + demand.getQtd()))
                .subscribe(System.out::println);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions