Lionel Briand
10/28/2023, 5:41 PMEither
or Option
class in your current project ?
I found these patterns quite useful and I've used them in my code for quite a while. I have taken the time to share my implementation with everyone !
If you are interested, you can check out the published lib and source here: https://github.com/L-Briand/either
This lib is multiplatform, feel free to test it on your project and share your thought. If you like it, maybe star the projet too. Thanks 👋Aleksey Tomin
10/28/2023, 5:44 PMResult
?Jacob Ras
10/28/2023, 5:49 PMLionel Briand
10/28/2023, 5:50 PMMikhail
10/28/2023, 6:09 PMOperationResult<T>
because I need to serialize/deserialize object and transfer it via network.CLOVIS
10/28/2023, 7:24 PMcurioustechizen
10/29/2023, 4:36 AMMarko Novaković
10/30/2023, 11:29 AM?.
and :?
Lionel Briand
10/30/2023, 1:48 PMfun timeout(block: () -> T) = try {
val result = withTimeout(1.second) { block() }
Some(result)
} catch (e: TimeoutCancellationException) {
None
}