hi, I need to get image either from local storage, or if unavailable remote storage, or in worst case scenario get original and resize it. Lets say I have following:
Copy code
IO.fx {
val local: File? = getLocalFile().bind()
val remote: File? = getCorrectSizeFromStorage().bind()
val result: File? = getOriginalFromStorageAndResize().bind()
}
Is there any nice pattern to short circuit the computation on first non-null value it finds?
than_
03/23/2020, 11:47 AM
might have overthought it. the answer, for anybody interested, is elvis operator :D