Closed evant closed 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.
signInWithApple
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:
This increases flexibility, improves testability, and is a more clear separation of concerns. Ex: you can mock out
signInWithApple
in your UI test.