Last active
September 26, 2023 11:11
-
-
Save minsOne/90a26e25ea1816a2aa1c02703f690b24 to your computer and use it in GitHub Desktop.
SwiftUI DataState
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum DataState<V, E: Error> { | |
case idle | |
case initialLoading case reLoading (V) | |
case retryLoading (E) | |
case success (V) | |
case failure(E) | |
case paging (V) | |
case pagingFailure(V, E) | |
} | |
@State private var dataState: DataState< [Post], any Error> = idle |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://speakerdeck.com/kntkymt/swiftuidenofei-tong-qi-chu-li-detanozhuang-tai-guan-li-wokao-eru
https://github.com/kntkymt/AsyncDataManagementSamples
https://zenn.dev/kntk/articles/d1090ada19d3f5