willowtreeapps / sign-in-with-apple-button-android

An Android library for Sign In with Apple
MIT License
283 stars 68 forks source link

Consider better seperation between the ui and the domain. #26

Closed evant closed 5 years ago

evant commented 5 years ago

While I've seen other libs do this (ex: AdMob) I'm really not a fan of tying the button UI with the actual domain logic here. Would prefer instead for these to be 2 distinct pieces that you can use independently, ex, something like:

val signInWithApple = ...

button.setOnClickListener {
    signInWithApple.launch(clientId= ..., redirectUri = ..., scope = ...)
}

This increases flexibility, improves testability, and is a more clear separation of concerns. Ex: you can mock out signInWithApple in your UI test.