Skip to content

Commit

Permalink
feat: 🎸 xctemplate
Browse files Browse the repository at this point in the history
  • Loading branch information
tomokisun committed Dec 25, 2023
1 parent 528e0b8 commit f568bb7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .swiftformat
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# file options

--exclude ./XCTemplates

# format options

--stripunusedargs closure-only
Expand Down
8 changes: 4 additions & 4 deletions XCTemplates/TCA.xctemplate/___FILEBASENAME___.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ public struct ___VARIABLE_productName: identifier___Logic {
public init() {}
}

public enum Action: Equatable {
public enum Action {
case onTask
case onAppear
}

@Dependency(\.analytics) var analytics

public var body: some Reducer<State, Action> {
Reduce<State, Action> { _, action in
Reduce<State, Action> { state, action in
switch action {
case .onTask:
return .none
Expand All @@ -39,11 +39,11 @@ public struct ___VARIABLE_productName:identifier___View: View {
}

public var body: some View {
WithViewStore(store, observe: { $0 }) { _ in
WithViewStore(store, observe: { $0 }) { viewStore in
List {
Text("___VARIABLE_productName:identifier___", bundle: .module)
}
.navigationTitle("___VARIABLE_productName:identifier___")
.navigationTitle(String(localized: "___VARIABLE_productName:identifier___", bundle: .module))
.navigationBarTitleDisplayMode(.inline)
.task { await store.send(.onTask).finish() }
.onAppear { store.send(.onAppear) }
Expand Down

0 comments on commit f568bb7

Please sign in to comment.