-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from DroidKaigi/MrSmart00/feature/empty-features
- Loading branch information
Showing
11 changed files
with
258 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
app-ios/Sources/ContributorFeature/ContributorReducer.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import ComposableArchitecture | ||
|
||
@Reducer | ||
public struct ContributorReducer { | ||
public init() { } | ||
|
||
@ObservableState | ||
public struct State: Equatable { | ||
var text: String | ||
} | ||
|
||
public enum Action { | ||
case onAppear | ||
} | ||
|
||
public var body: some ReducerOf<Self> { | ||
Reduce { state, action in | ||
switch action { | ||
case .onAppear: | ||
state.text = "Contributor Feature" | ||
return .none | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import ComposableArchitecture | ||
import SwiftUI | ||
|
||
public struct ContributorView: View { | ||
private let store: StoreOf<ContributorReducer> | ||
|
||
public init(store: StoreOf<ContributorReducer>) { | ||
self.store = store | ||
} | ||
|
||
public var body: some View { | ||
Text(store.text) | ||
.onAppear { | ||
store.send(.onAppear) | ||
} | ||
} | ||
} | ||
|
||
#Preview { | ||
ContributorView(store: .init(initialState: .init(text: "Hoge"), reducer: { ContributorReducer() })) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import ComposableArchitecture | ||
|
||
@Reducer | ||
public struct SponsorReducer { | ||
public init() { } | ||
|
||
@ObservableState | ||
public struct State: Equatable { | ||
var text: String | ||
} | ||
|
||
public enum Action { | ||
case onAppear | ||
} | ||
|
||
public var body: some ReducerOf<Self> { | ||
Reduce { state, action in | ||
switch action { | ||
case .onAppear: | ||
state.text = "Sponsor Feature" | ||
return .none | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import ComposableArchitecture | ||
import SwiftUI | ||
|
||
public struct SponsorView: View { | ||
private let store: StoreOf<SponsorReducer> | ||
|
||
public init(store: StoreOf<SponsorReducer>) { | ||
self.store = store | ||
} | ||
|
||
public var body: some View { | ||
Text(store.text) | ||
.onAppear { | ||
store.send(.onAppear) | ||
} | ||
} | ||
} | ||
|
||
#Preview { | ||
SponsorView(store: .init(initialState: .init(text: "Hoge"), reducer: { SponsorReducer() })) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import ComposableArchitecture | ||
|
||
@Reducer | ||
public struct StaffReducer { | ||
public init() { } | ||
|
||
@ObservableState | ||
public struct State: Equatable { | ||
var text: String | ||
} | ||
|
||
public enum Action { | ||
case onAppear | ||
} | ||
|
||
public var body: some ReducerOf<Self> { | ||
Reduce { state, action in | ||
switch action { | ||
case .onAppear: | ||
state.text = "Staff Feature" | ||
return .none | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import ComposableArchitecture | ||
import SwiftUI | ||
|
||
public struct StaffView: View { | ||
private let store: StoreOf<StaffReducer> | ||
|
||
public init(store: StoreOf<StaffReducer>) { | ||
self.store = store | ||
} | ||
|
||
public var body: some View { | ||
Text(store.text) | ||
.onAppear { | ||
store.send(.onAppear) | ||
} | ||
} | ||
} | ||
|
||
#Preview { | ||
StaffView(store: .init(initialState: .init(text: "Hoge"), reducer: { StaffReducer() })) | ||
} |
17 changes: 17 additions & 0 deletions
17
app-ios/Tests/ContributorFeatureTests/ContributorFeatureTests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import XCTest | ||
import ComposableArchitecture | ||
@testable import ContributorFeature | ||
|
||
final class ContributorFeatureTests: XCTestCase { | ||
|
||
@MainActor | ||
func testExample() async throws { | ||
let store = TestStore(initialState: ContributorReducer.State(text: "HOGE")) { | ||
ContributorReducer() | ||
} | ||
await store.send(.onAppear) { | ||
$0.text = "Contributor Feature" | ||
} | ||
} | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
app-ios/Tests/SponsorFeatureTests/SponsorFeatureTests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import XCTest | ||
import ComposableArchitecture | ||
@testable import SponsorFeature | ||
|
||
final class SponsorFeatureTests: XCTestCase { | ||
|
||
@MainActor | ||
func testExample() async throws { | ||
let store = TestStore(initialState: SponsorReducer.State(text: "HOGE")) { | ||
SponsorReducer() | ||
} | ||
await store.send(.onAppear) { | ||
$0.text = "Sponsor Feature" | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import XCTest | ||
import ComposableArchitecture | ||
@testable import StaffFeature | ||
|
||
final class StaffFeatureTests: XCTestCase { | ||
|
||
@MainActor | ||
func testExample() async throws { | ||
let store = TestStore(initialState: StaffReducer.State(text: "HOGE")) { | ||
StaffReducer() | ||
} | ||
await store.send(.onAppear) { | ||
$0.text = "Staff Feature" | ||
} | ||
} | ||
|
||
} |