Slide 125
Slide 125 text
#JOEBCMF'FUDI7JFX4UZMF
@State private var dataState: PagingDataState<[Post], any Error> = .idle
var body: some View {
PagingList(
dataState: $dataState,
success: listContent,
fetchInitial: { try await API.getPosts(minId: 0, count: 30) },
fetchMore: { try await API.getPosts(minId: $0.id + 1, count: 30) }
)
.onChange(of: dataState.isFailure) { isFailure in
guard isFailure, let error = dataState.error else { return }
MessageBanner.showError("Τϥʔ͕ൃੜ͠·ͨ͠", with: error.localizedDescription)
}
}
FOVNίϯϙʔωϯτʹΑΔঢ়ଶཧ