Skip to content

Commit

Permalink
Remove CombineFeedbackUI
Browse files Browse the repository at this point in the history
  • Loading branch information
sergdort committed Jun 15, 2021
1 parent d03e9ec commit 4328457
Show file tree
Hide file tree
Showing 20 changed files with 196 additions and 566 deletions.
331 changes: 14 additions & 317 deletions CombineFeedback.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion Example/CounterExample/Counter.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Combine
import CombineFeedback
import CombineFeedbackUI
import SwiftUI

extension Counter {
Expand Down
1 change: 0 additions & 1 deletion Example/MoviesExample/Movies.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Combine
import CombineFeedback
import CombineFeedbackUI
import Foundation
import SwiftUI

Expand Down
2 changes: 1 addition & 1 deletion Example/SceneDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import CombineFeedbackUI
import SwiftUI
import UIKit
import CombineFeedback

class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
Expand Down
1 change: 0 additions & 1 deletion Example/SignIn/SignIn.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Combine
import CombineFeedback
import CombineFeedbackUI
import SwiftUI

extension SignIn {
Expand Down
1 change: 0 additions & 1 deletion Example/SingleStoreExample/SingleStoreExampleView.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import CombineFeedback
import CombineFeedbackUI
import SwiftUI

struct SingleStoreExampleView: View {
Expand Down
97 changes: 48 additions & 49 deletions Example/SingleStoreExample/State.swift
Original file line number Diff line number Diff line change
@@ -1,88 +1,87 @@
import Combine
import CombineFeedback
import CombineFeedbackUI
import Foundation
import CasePaths
import Foundation

struct State {
var counter = Counter.State()
var movies = Movies.State(batch: .empty(), movies: [], status: .loading)
var signIn = SignIn.State()
var traficLight = TrafficLight.State.red
var counter = Counter.State()
var movies = Movies.State(batch: .empty(), movies: [], status: .loading)
var signIn = SignIn.State()
var traficLight = TrafficLight.State.red
}

enum Event {
case counter(Counter.Event)
case movies(Movies.Event)
case signIn(SignIn.Event)
case trafficLight(TrafficLight.Event)
case counter(Counter.Event)
case movies(Movies.Event)
case signIn(SignIn.Event)
case trafficLight(TrafficLight.Event)
}

let countReducer: Reducer<State, Event> = Counter.reducer()
.pullback(
value: \.counter,
event: /Event.counter
)
.pullback(
value: \.counter,
event: /Event.counter
)

let moviesReducer: Reducer<State, Event> = Movies.reducer()
.pullback(
value: \.movies,
event: /Event.movies
)
.pullback(
value: \.movies,
event: /Event.movies
)

let moviesFeedback: Feedback<State, Event, AppDependency> = Movies.feedback
.pullback(
value: \.movies,
event: /Event.movies,
dependency: \.movies
)
.pullback(
value: \.movies,
event: /Event.movies,
dependency: \.movies
)

let signInReducer: Reducer<State, Event> = SignIn.reducer().pullback(
value: \.signIn,
event: /Event.signIn
value: \.signIn,
event: /Event.signIn
)

let signInFeedback: Feedback<State, Event, AppDependency> = SignIn.feedback
.pullback(
value: \.signIn,
event: /Event.signIn,
dependency: \.signIn
)
.pullback(
value: \.signIn,
event: /Event.signIn,
dependency: \.signIn
)

let traficLightReducer: Reducer<State, Event> = TrafficLight.reducer()
.pullback(
value: \.traficLight,
event: /Event.trafficLight
)
.pullback(
value: \.traficLight,
event: /Event.trafficLight
)

let trafficLightFeedback: Feedback<State, Event, AppDependency> = TrafficLight.feedback.pullback(
value: \.traficLight,
event: /Event.trafficLight,
dependency: { _ in }
value: \.traficLight,
event: /Event.trafficLight,
dependency: { _ in }
)

let appReducer = Reducer.combine(
countReducer,
moviesReducer,
signInReducer,
traficLightReducer
countReducer,
moviesReducer,
signInReducer,
traficLightReducer
)

struct AppDependency {
let urlSession = URLSession.shared
let api = GithubAPI()

var movies: Movies.Dependencies {
.init(
movies: urlSession.movies(page:),
fetchMovies: urlSession.fetchMovies(page:)
)
.init(
movies: urlSession.movies(page:),
fetchMovies: urlSession.fetchMovies(page:)
)
}

var signIn: SignIn.Dependencies {
.init(
signIn: api.signIn,
usernameAvailable: api.usernameAvailable(username:)
)
.init(
signIn: api.signIn,
usernameAvailable: api.usernameAvailable(username:)
)
}
}
1 change: 0 additions & 1 deletion Example/TrafficLight/TrafficLight.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Combine
import CombineFeedback
import CombineFeedbackUI
import SwiftUI

extension TrafficLight {
Expand Down
2 changes: 1 addition & 1 deletion Example/TrafficLight/TrafficLightView.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import SwiftUI
import CombineFeedbackUI
import CombineFeedback

struct TrafficLightView: View {
let store: Store<TrafficLight.State, TrafficLight.Event>
Expand Down
1 change: 0 additions & 1 deletion Example/Views/StoreExtensions.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import CombineFeedbackUI
import CombineFeedback

extension Store {
Expand Down
7 changes: 2 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ let package = Package(
],
products: [
.library(name: "CombineFeedback", targets: ["CombineFeedback"]),
.library(name: "CombineFeedbackUI", targets: ["CombineFeedbackUI"]),
],
dependencies: [
.package(
Expand All @@ -24,10 +23,8 @@ let package = Package(
)
],
targets: [
.target(name: "CombineFeedback", dependencies: ["CasePaths"]),
.target(name: "CombineFeedbackUI", dependencies: ["CombineFeedback"]),
.testTarget(name: "CombineFeedbackTests", dependencies: ["CombineFeedback"]),
.testTarget(name: "CombineFeedbackUITests", dependencies: ["CombineFeedback", "CombineFeedbackUI"]),
.target(name: "CombineFeedback", dependencies: ["CasePaths", "CombineSchedulers"]),
.testTarget(name: "CombineFeedbackTests", dependencies: ["CombineFeedback"])
],
swiftLanguageVersions: [.v5]
)
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Combine
import CombineFeedback
import SwiftUI

@available(*, deprecated, renamed: "WithViewContext")
Expand Down
9 changes: 0 additions & 9 deletions Sources/CombineFeedbackUI/CombineFeedbackUI.h

This file was deleted.

22 changes: 0 additions & 22 deletions Sources/CombineFeedbackUI/Info.plist

This file was deleted.

1 change: 0 additions & 1 deletion Sources/CombineFeedbackUI/Store/Store.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Combine
import CombineFeedback
import Foundation
import CasePaths

Expand Down
1 change: 0 additions & 1 deletion Sources/CombineFeedbackUI/Store/StoreBox.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Combine
import CombineFeedback
import CasePaths
import SwiftUI

Expand Down
Loading

0 comments on commit 4328457

Please sign in to comment.