-
Notifications
You must be signed in to change notification settings - Fork 10
[Android] Remove com.github.michaelbull #473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| * A monad for modeling success or failure operations in the Capture SDK. | ||
| */ | ||
| typealias CaptureResult<V> = com.github.michaelbull.result.Result<V, Error> | ||
| sealed class CaptureResult<out V> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since refactoring this will touch all existing references, why CaptureResult instead of just Result since this is already in the capture package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually i thought about it, but wanted to minimize noise to existing customer that rely on CaptureResult
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, I didn't realize this class/alias was public
platform/jvm/capture/src/main/kotlin/io/bitdrift/capture/Models.kt
Outdated
Show resolved
Hide resolved
platform/jvm/capture/src/main/kotlin/io/bitdrift/capture/Models.kt
Outdated
Show resolved
Hide resolved
| * A monad for modeling success or failure operations in the Capture SDK. | ||
| */ | ||
| typealias CaptureResult<V> = com.github.michaelbull.result.Result<V, Error> | ||
| sealed class CaptureResult<out V> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should take a look at the library we used, it can be helpful as a reference implementation for things like this:
The Result type is modelled as an inline value class. This achieves zero object allocations on the happy path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not saying we have to do it that way but it's a neat property of the library
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup very neat indeed
📦 APK Size Report
|
platform/jvm/capture/src/main/kotlin/io/bitdrift/capture/Capture.kt
Outdated
Show resolved
Hide resolved
| val typedRequest = DeviceCodeRequest(deviceId) | ||
|
|
||
| apiClient.perform<DeviceCodeRequest, DeviceCodeResponse>(HttpApiEndpoint.GetTemporaryDeviceCode, typedRequest) { result -> | ||
| completion(result.map { it.code }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok so it looks like all things being equal this is the only nice method we lost (map), which doesn't sound like the end of the world to me
murki
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm overall supportive of this change.
📦 APK Size Report
|
What
Removes dependency on
com.github.michaelbullfor 'CaptureResult'NOTE: These updated CaptureResult will be used on #474
Verification
Verified on this session