Skip to content

Commit

Permalink
Merge pull request #17 from rokon-uddin/refactor_repository
Browse files Browse the repository at this point in the history
chore: refactor the repository by implementing generics
  • Loading branch information
Mohammed Rokon Uddin authored Feb 12, 2024
2 parents 642c30c + ca76092 commit b6a161d
Show file tree
Hide file tree
Showing 79 changed files with 2,658 additions and 4,935 deletions.
102 changes: 51 additions & 51 deletions TCA.xctemplate/___FILEBASENAME___/___FILEBASENAME___Feature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,61 +6,61 @@
//___COPYRIGHT___
//

import Domain
import Commons
import Foundation
import ComposableArchitecture
import Domain
import Foundation

public struct ___VARIABLE_moduleName___Feature: Reducer {

public struct State: Equatable {
public init() {}
}

public enum Action: BaseAction {

enum ViewAction: Equatable {
case onAppear

public struct ___VARIABLE_moduleName___Feature: Reducer {

public struct State: Equatable {
public init() {}
}

public enum Action: BaseAction {

enum ViewAction: Equatable {
case onAppear

}

enum InlyingAction: Equatable {

}

enum DelegateAction: Equatable {

}

case view(ViewAction)
case inlying(InlyingAction)
case delegate(DelegateAction)

enum InlyingAction: Equatable {

}

public func reduce(into state: inout State, action: Action) -> Effect<Action> {
switch action {
case .view(let action):
switch action {
case .onAppear:
return .none

}
case .inlying(let action):
switch action {

}
case .delegate(let action):
switch action {

}
}

enum DelegateAction: Equatable {

}

// Remove commented code if not needed
// public var body: some Reducer<State, Action> {
//
// Reduce { state, action in
//
// }
// }

case view(ViewAction)
case inlying(InlyingAction)
case delegate(DelegateAction)
}

public func reduce(into state: inout State, action: Action) -> Effect<Action> {
switch action {
case .view(let action):
switch action {
case .onAppear:
return .none

}
case .inlying(let action):
switch action {

}
case .delegate(let action):
switch action {

}
}
}

// Remove commented code if not needed
// public var body: some Reducer<State, Action> {
//
// Reduce { state, action in
//
// }
// }
}
24 changes: 12 additions & 12 deletions TCA.xctemplate/___FILEBASENAME___/___FILEBASENAME___View.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@
//___COPYRIGHT___
//

import SwiftUI
import Commons
import Resources
import ComposableArchitecture
import Resources
import SwiftUI

public struct ___VARIABLE_moduleName___View: View {
let store: StoreOf<___VARIABLE_moduleName___Feature>
let store: StoreOf<___VARIABLE_moduleName___Feature>

public init(store: StoreOf<___VARIABLE_moduleName___Feature>) {
self.store = store
}
public init(store: StoreOf<___VARIABLE_moduleName___Feature>) {
self.store = store
}

public var body: some View {
WithViewStore(self.store, observe: { $0 }) { viewStore in
Text("Hello World!!!")
.onAppear {
viewStore.send(.onAppear)
}
public var body: some View {
WithViewStore(self.store, observe: { $0 }) { viewStore in
Text("Hello World!!!")
.onAppear {
viewStore.send(.onAppear)
}
}
}
}
56 changes: 56 additions & 0 deletions {{cookiecutter.app_name}}/.swift-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"fileScopedDeclarationPrivacy" : {
"accessLevel" : "private"
},
"indentation" : {
"spaces" : 2
},
"indentConditionalCompilationBlocks" : true,
"indentSwitchCaseLabels" : false,
"lineBreakAroundMultilineExpressionChainComponents" : false,
"lineBreakBeforeControlFlowKeywords" : false,
"lineBreakBeforeEachArgument" : false,
"lineBreakBeforeEachGenericRequirement" : false,
"lineLength" : 80,
"tabWidth" : 8,
"maximumBlankLines" : 1,
"prioritizeKeepingFunctionOutputTogether" : false,
"respectsExistingLineBreaks" : true,
"version" : 1,
"rules" : {
"AllPublicDeclarationsHaveDocumentation" : false,
"AlwaysUseLowerCamelCase" : true,
"AmbiguousTrailingClosureOverload" : true,
"BeginDocumentationCommentWithOneLineSummary" : false,
"DoNotUseSemicolons" : true,
"DontRepeatTypeInStaticProperties" : true,
"FileScopedDeclarationPrivacy" : true,
"FullyIndirectEnum" : true,
"GroupNumericLiterals" : true,
"IdentifiersMustBeASCII" : true,
"NeverForceUnwrap" : false,
"NeverUseForceTry" : false,
"NeverUseImplicitlyUnwrappedOptionals" : false,
"NoAccessLevelOnExtensionDeclaration" : true,
"NoBlockComments" : true,
"NoCasesWithOnlyFallthrough" : true,
"NoEmptyTrailingClosureParentheses" : true,
"NoLabelsInCasePatterns" : true,
"NoLeadingUnderscores" : false,
"NoParensAroundConditions" : true,
"NoVoidReturnOnFunctionSignature" : true,
"OneCasePerLine" : true,
"OneVariableDeclarationPerLine" : true,
"OnlyOneTrailingClosureArgument" : false,
"OrderedImports" : true,
"ReturnVoidInsteadOfEmptyTuple" : true,
"UseEarlyExits" : false,
"UseLetInEveryBoundCaseVariable" : false,
"UseShorthandTypeNames" : true,
"UseSingleLinePropertyGetter" : true,
"UseSynthesizedInitializer" : true,
"UseTripleSlashForDocumentationComments" : true,
"UseWhereClausesInForLoops" : false,
"ValidateDocumentationComments" : false
}
}
5 changes: 0 additions & 5 deletions {{cookiecutter.app_name}}/.swiftformat

This file was deleted.

44 changes: 23 additions & 21 deletions {{cookiecutter.app_name}}/Common/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,27 @@
import PackageDescription

let package = Package(
name: "Common",
platforms: [.macOS(.v12), .iOS(.v15)],
products: [
.library(
name: "Common",
targets: ["Common"]),
],
dependencies: [
.package(
url: "https://github.com/pointfreeco/swift-composable-architecture",
exact: "1.5.1"
),
],
targets: [
.target(
name: "Common",
dependencies: [
.product(name: "ComposableArchitecture", package: "swift-composable-architecture"),
]
),
]
name: "Common",
platforms: [.macOS(.v12), .iOS(.v15)],
products: [
.library(
name: "Common",
targets: ["Common"])
],
dependencies: [
.package(
url: "https://github.com/pointfreeco/swift-composable-architecture",
exact: "1.5.1"
)
],
targets: [
.target(
name: "Common",
dependencies: [
.product(
name: "ComposableArchitecture",
package: "swift-composable-architecture")
]
)
]
)
Loading

0 comments on commit b6a161d

Please sign in to comment.