Skip to content

Commit 9df30e2

Browse files
Rename State to StoreState to avoid conflicts with Alamofire’s State
1 parent 2b1587f commit 9df30e2

File tree

5 files changed

+30
-31
lines changed

5 files changed

+30
-31
lines changed

Mini.xcodeproj/project.pbxproj

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@
6868
F22A38B8227C60000012C010 /* Interceptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = F22A38A2227C60000012C010 /* Interceptor.swift */; };
6969
F22A38B9227C60000012C010 /* Interceptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = F22A38A2227C60000012C010 /* Interceptor.swift */; };
7070
F22A38BA227C60000012C010 /* Interceptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = F22A38A2227C60000012C010 /* Interceptor.swift */; };
71-
F22A38BB227C60000012C010 /* State.swift in Sources */ = {isa = PBXBuildFile; fileRef = F22A38A3227C60000012C010 /* State.swift */; };
72-
F22A38BC227C60000012C010 /* State.swift in Sources */ = {isa = PBXBuildFile; fileRef = F22A38A3227C60000012C010 /* State.swift */; };
73-
F22A38BD227C60000012C010 /* State.swift in Sources */ = {isa = PBXBuildFile; fileRef = F22A38A3227C60000012C010 /* State.swift */; };
74-
F22A38BE227C60000012C010 /* State.swift in Sources */ = {isa = PBXBuildFile; fileRef = F22A38A3227C60000012C010 /* State.swift */; };
71+
F22A38BB227C60000012C010 /* StoreState.swift in Sources */ = {isa = PBXBuildFile; fileRef = F22A38A3227C60000012C010 /* StoreState.swift */; };
72+
F22A38BC227C60000012C010 /* StoreState.swift in Sources */ = {isa = PBXBuildFile; fileRef = F22A38A3227C60000012C010 /* StoreState.swift */; };
73+
F22A38BD227C60000012C010 /* StoreState.swift in Sources */ = {isa = PBXBuildFile; fileRef = F22A38A3227C60000012C010 /* StoreState.swift */; };
74+
F22A38BE227C60000012C010 /* StoreState.swift in Sources */ = {isa = PBXBuildFile; fileRef = F22A38A3227C60000012C010 /* StoreState.swift */; };
7575
F22A38BF227C60000012C010 /* StoreProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = F22A38A4227C60000012C010 /* StoreProperties.swift */; };
7676
F22A38C0227C60000012C010 /* StoreProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = F22A38A4227C60000012C010 /* StoreProperties.swift */; };
7777
F22A38C1227C60000012C010 /* StoreProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = F22A38A4227C60000012C010 /* StoreProperties.swift */; };
@@ -162,7 +162,7 @@
162162
F22A389F227C60000012C010 /* Action.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Action.swift; sourceTree = "<group>"; };
163163
F22A38A1227C60000012C010 /* Dispatcher.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Dispatcher.swift; sourceTree = "<group>"; };
164164
F22A38A2227C60000012C010 /* Interceptor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Interceptor.swift; sourceTree = "<group>"; };
165-
F22A38A3227C60000012C010 /* State.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = State.swift; sourceTree = "<group>"; };
165+
F22A38A3227C60000012C010 /* StoreState.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoreState.swift; sourceTree = "<group>"; };
166166
F22A38A4227C60000012C010 /* StoreProperties.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoreProperties.swift; sourceTree = "<group>"; };
167167
F22A38A5227C60000012C010 /* MiniError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MiniError.swift; sourceTree = "<group>"; };
168168
F22A38A6227C60000012C010 /* Store.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Store.swift; sourceTree = "<group>"; };
@@ -373,8 +373,8 @@
373373
F22A38A1227C60000012C010 /* Dispatcher.swift */,
374374
F22A38A5227C60000012C010 /* MiniError.swift */,
375375
F22A38A2227C60000012C010 /* Interceptor.swift */,
376-
F22A38A3227C60000012C010 /* State.swift */,
377376
F22A38A6227C60000012C010 /* Store.swift */,
377+
F22A38A3227C60000012C010 /* StoreState.swift */,
378378
F22A38A4227C60000012C010 /* StoreProperties.swift */,
379379
F22A389E227C60000012C010 /* Threading.swift */,
380380
F22A3577228086A2004E8546 /* Task.swift */,
@@ -737,7 +737,7 @@
737737
F22A38C7227C60000012C010 /* Store.swift in Sources */,
738738
F22A3578228086A2004E8546 /* Task.swift in Sources */,
739739
F26C3AF822537A4600189D28 /* Mini.swift in Sources */,
740-
F22A38BB227C60000012C010 /* State.swift in Sources */,
740+
F22A38BB227C60000012C010 /* StoreState.swift in Sources */,
741741
F22A38B3227C60000012C010 /* Dispatcher.swift in Sources */,
742742
);
743743
runOnlyForDeploymentPostprocessing = 0;
@@ -766,7 +766,7 @@
766766
F22A38C8227C60000012C010 /* Store.swift in Sources */,
767767
F22A3579228086A2004E8546 /* Task.swift in Sources */,
768768
F26C3AF922537A4600189D28 /* Mini.swift in Sources */,
769-
F22A38BC227C60000012C010 /* State.swift in Sources */,
769+
F22A38BC227C60000012C010 /* StoreState.swift in Sources */,
770770
F22A38B4227C60000012C010 /* Dispatcher.swift in Sources */,
771771
);
772772
runOnlyForDeploymentPostprocessing = 0;
@@ -795,7 +795,7 @@
795795
F22A38C9227C60000012C010 /* Store.swift in Sources */,
796796
F22A357A228086A2004E8546 /* Task.swift in Sources */,
797797
F26C3AFA22537A4600189D28 /* Mini.swift in Sources */,
798-
F22A38BD227C60000012C010 /* State.swift in Sources */,
798+
F22A38BD227C60000012C010 /* StoreState.swift in Sources */,
799799
F22A38B5227C60000012C010 /* Dispatcher.swift in Sources */,
800800
);
801801
runOnlyForDeploymentPostprocessing = 0;
@@ -824,7 +824,7 @@
824824
F22A38CA227C60000012C010 /* Store.swift in Sources */,
825825
F22A357B228086A2004E8546 /* Task.swift in Sources */,
826826
F26C3AFB22537A4600189D28 /* Mini.swift in Sources */,
827-
F22A38BE227C60000012C010 /* State.swift in Sources */,
827+
F22A38BE227C60000012C010 /* StoreState.swift in Sources */,
828828
F22A38B6227C60000012C010 /* Dispatcher.swift in Sources */,
829829
);
830830
runOnlyForDeploymentPostprocessing = 0;

Source/Flux/State.swift

Lines changed: 0 additions & 19 deletions
This file was deleted.

Source/Flux/Store.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
22
import RxSwift
33

4-
public class Store<S: State, SC: Disposable>: StoreType {
4+
public class Store<S: StoreState, SC: Disposable>: StoreType {
55

66
public typealias AssociatedState = S
77

Source/Flux/StoreState.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import Foundation
2+
3+
public protocol StoreState: Changeable {
4+
func isEqualTo(_ other: StoreState) -> Bool
5+
}
6+
7+
public extension StoreState where Self: Equatable {
8+
func isEqualTo(_ other: StoreState) -> Bool {
9+
guard let other = other as? Self else { return false }
10+
return self == other
11+
}
12+
}
13+
14+
public extension StoreState {
15+
var innerTag: String {
16+
return String(describing: type(of: self))
17+
}
18+
}

Source/Protocols/StoreType.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Foundation
22
import RxSwift
33

44
public protocol StoreType: class {
5-
associatedtype AssociatedState: State
5+
associatedtype AssociatedState: StoreState
66

77
var processor: BehaviorSubject<AssociatedState> { get set }
88
var initialState: AssociatedState { get set }

0 commit comments

Comments
 (0)