packaging some basic boilerplate functions.
import YASU
@State private var myDataType: MyDataType?
var body: some View {
let myDataSourceUrl = URL(string: "https://my.datasource.url")!
VStack {
Text(myDataType.SomePropertyValue ?? "")
}
.task{
await myDataType = loadData(myDataSourceUrl)
}
}
var myDataType: MyDataType = Bundle.main.decode("MyBundledJsonFile.json")
var body: some View {
VStack {
Text(myDataType.SomePropertyValue)
}
}