clean up reproducer target

This commit is contained in:
Lukas Stabe 2023-01-23 17:52:45 +01:00
parent 514599fbd9
commit 6583249ab7
2 changed files with 0 additions and 76 deletions

View File

@ -15,7 +15,6 @@ let package = Package(
name: "TokamakDemo",
targets: ["TokamakDemo"]
),
.executable(name: "RecRep", targets: ["RecRep"]),
.library(
name: "TokamakDOM",
targets: ["TokamakDOM"]
@ -168,17 +167,6 @@ let package = Package(
"OpenCombineJS",
]
),
.executableTarget(
name: "RecRep",
dependencies: [
"TokamakShim",
.product(
name: "JavaScriptKit",
package: "JavaScriptKit",
condition: .when(platforms: [.wasi])
),
]
),
.executableTarget(
name: "TokamakDemo",
dependencies: [

View File

@ -1,64 +0,0 @@
import TokamakDOM
import Foundation
@main
struct TokamakApp: App {
static let _configuration: _AppConfiguration = .init(reconciler: .fiber(useDynamicLayout: false))
var body: some Scene { WindowGroup("Tokamak App") { ContentView() } }
}
enum State {
case a
case b([String])
case c(String, [Int])
case d(String, [Int], String)
}
final class StateManager: ObservableObject {
private init() { }
static let shared = StateManager()
@Published var state = State.a //b(["eins", "2", "III"])
}
struct ContentView: View {
@ObservedObject var sm = StateManager.shared
var body: some View {
switch sm.state {
case .a:
Button("go to b") {
sm.state = .b(["eins", "zwei", "drei"])
}
case .b(let arr):
VStack {
Text("b:")
ForEach(arr, id: \.self) { s in
Button(s) {
sm.state = .c(s, s == "zwei" ? [1, 2] : [1])
}
}
}
case .c(let str, let ints):
VStack {
Text("c \(str)")
.font(.headline)
Text("hello there")
ForEach(ints, id: \.self) { i in
let d = "i = \(i)"
Button(d) {
sm.state = .d(str, ints, d)
}
}
}
case .d(_, let ints, let other):
VStack {
Text("d \(other)")
Text("count \(ints.count)")
Button("back") {
sm.state = .a
}
}
}
}
}