hi, I need to get image either from local storage,...
# arrow
t
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?
might have overthought it. the answer, for anybody interested, is elvis operator :D
p
😄
elvis is
handleErrorWith
for nullables
t
thanks! that takes care of it better