Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrandonw committed Dec 21, 2023
1 parent 6ea9ea8 commit b2c2d1a
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 30 deletions.
4 changes: 1 addition & 3 deletions Sources/AppFeature/AppView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,7 @@ public struct AppView: View {
self.store.scope(state: \.destination?.game, action: \.destination.game)
) { store in
GameView(
content: CubeView(
viewStore: ViewStore(store.scope(state: \.cubeScene, action: \.cubeScene), observe: { $0 })
),
content: CubeView(store: store.scope(state: \.cubeScene, action: \.cubeScene)),
store: store
)
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/CubeCore/CubeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import SwiftUI
public struct CubeView: View {
public let viewStore: ViewStore<CubeSceneView.ViewState, CubeSceneView.ViewAction>

public init(viewStore: ViewStore<CubeSceneView.ViewState, CubeSceneView.ViewAction>) {
self.viewStore = viewStore
public init(store: Store<CubeSceneView.ViewState, CubeSceneView.ViewAction>) {
self.viewStore = ViewStore(store, observe: { $0 })
}

public var body: some View {
Expand Down
7 changes: 1 addition & 6 deletions Sources/CubePreview/CubePreviewView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,7 @@ public struct CubePreviewView: View {
.adaptivePadding(.top, .grid(16))
}

CubeView(
viewStore: ViewStore(
self.store.scope(state: \.cubeScenePreview, action: \.cubeScene),
observe: { $0 }
)
)
CubeView(store: self.store.scope(state: \.cubeScenePreview, action: \.cubeScene))
.task { await self.viewStore.send(.task).finish() }
}
.background(
Expand Down
7 changes: 1 addition & 6 deletions Sources/DemoFeature/Demo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,7 @@ public struct DemoView: View {
CaseLet(\Demo.State.Step.game, action: Demo.Action.game) { store in
GameWrapper(
content: GameView(
content: CubeView(
viewStore: ViewStore(
store.scope(state: \.cubeScene, action: \.cubeScene),
observe: { $0 }
)
),
content: CubeView(store: store.scope(state: \.cubeScene, action: \.cubeScene)),
store: store
),
isGameOver: self.viewStore.isGameOver,
Expand Down
9 changes: 2 additions & 7 deletions Sources/OnboardingFeature/OnboardingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -409,13 +409,8 @@ public struct OnboardingView: View {

public var body: some View {
ZStack(alignment: .topTrailing) {
CubeView(
viewStore: ViewStore(
self.store.scope(state: \.cubeScene, action: \.game.cubeScene),
observe: { $0 }
)
)
.opacity(viewStore.step.isFullscreen ? 0 : 1)
CubeView(store: self.store.scope(state: \.cubeScene, action: \.game.cubeScene))
.opacity(viewStore.step.isFullscreen ? 0 : 1)

OnboardingStepView(store: self.store)

Expand Down
7 changes: 1 addition & 6 deletions Sources/TrailerFeature/Trailer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,7 @@ public struct TrailerView: View {
.adaptivePadding(.top, .grid(18))
.adaptivePadding(.bottom, .grid(2))

CubeView(
viewStore: ViewStore(
self.store.scope(state: \.cubeScene, action: \.game.cubeScene),
observe: { $0 }
)
)
CubeView(store: self.store.scope(state: \.cubeScene, action: \.game.cubeScene))
.adaptivePadding(
self.deviceState.idiom == .pad ? .horizontal : [],
.grid(30)
Expand Down

0 comments on commit b2c2d1a

Please sign in to comment.