dcampogiani / ktmp

Kotlin Multi Platform experiments
6 stars 1 forks source link

Add flatmap to request #11

Closed dcampogiani closed 5 years ago

dcampogiani commented 5 years ago

Add flatmap to request and example in android app.

I'm not able to write in swift, can someone update the iOS example app using flatmap? It should be something like:

            Api()
            .getUser("Donald90")
            .flatMap({
                  Api().getFollowers($0.followersUrl)
            })
            .executeCallback(
                onSuccess: {  },
                onError: {  })

Also, happy birthday @francomelandri

Gioevi90 commented 5 years ago

Guys, I've added a possible temporary implementation of the flatmap usage on requests on iOS side. Therefore, there is a problem: I wasn't able to remove the force unwrap to cast Request to Request. Any suggestion to remove that Is accepted :)

Thanks!

dcampogiani commented 5 years ago

I've created an issue to keep track of missing kotlin native feature we need to have a nice usage from iOS.

In the meantime can we merge the PR? @Donald90 @Harrypulvirenti @alexpopa95 @Faber92 @Gioevi90