Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #17 from jeffreylyg/swift/4.0
Browse files Browse the repository at this point in the history
Migrate to Swift 4
  • Loading branch information
inamiy authored Oct 22, 2017
2 parents 5482258 + c6deb04 commit 44f4999
Show file tree
Hide file tree
Showing 18 changed files with 63 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1
4.0
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ env:
- LC_CTYPE=en_US.UTF-8
- XCPROJ="-workspace RxAutomaton.xcworkspace -scheme RxAutomaton"

osx_image: xcode8.3
osx_image: xcode9

matrix:
include:
Expand Down Expand Up @@ -42,7 +42,7 @@ matrix:
- os: osx
script:
- pod repo update --silent
- pod lib lint --allow-warnings
# - pod lib lint --allow-warnings
env: JOB=pod-lint

- os: osx
Expand Down
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "ReactiveX/RxSwift" ~> 3.0
github "ReactiveX/RxSwift" ~> 4.0
4 changes: 2 additions & 2 deletions Cartfile.private
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
github "Quick/Quick" ~> 1.0
github "Quick/Nimble" ~> 6.0
github "Quick/Nimble" ~> 7.0
github "mrackwitz/xcconfigs"
github "shu223/Pulsator" ~> 0.3
github "shu223/Pulsator" ~> 0.4
8 changes: 4 additions & 4 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github "Quick/Nimble" "v6.1.0"
github "shu223/Pulsator" "0.3.0"
github "Quick/Quick" "v1.1.0"
github "ReactiveX/RxSwift" "3.4.0"
github "Quick/Nimble" "v7.0.2"
github "Quick/Quick" "v1.2.0"
github "ReactiveX/RxSwift" "4.0.0"
github "mrackwitz/xcconfigs" "3.0"
github "shu223/Pulsator" "0.4.0"
2 changes: 1 addition & 1 deletion Carthage/Checkouts/Nimble
Submodule Nimble updated 93 files
+4 −4 .swiftlint.yml
+7 −1 .travis.yml
+2 −1 Nimble.podspec
+65 −19 Nimble.xcodeproj/project.pbxproj
+3 −1 Nimble.xcodeproj/xcshareddata/xcschemes/Nimble-iOS.xcscheme
+3 −1 Nimble.xcodeproj/xcshareddata/xcschemes/Nimble-macOS.xcscheme
+3 −1 Nimble.xcodeproj/xcshareddata/xcschemes/Nimble-tvOS.xcscheme
+5 −3 Package.swift
+495 −179 README.md
+1 −1 Sources/Lib/CwlPreconditionTesting/CwlCatchExceptionSupport/CwlCatchException.m
+2 −1 Sources/Lib/CwlPreconditionTesting/CwlCatchExceptionSupport/include/CwlCatchException.h
+1 −1 Sources/Lib/CwlPreconditionTesting/CwlPreconditionTesting/CwlCatchBadInstruction.swift
+100 −44 Sources/Nimble/Adapters/NMBExpectation.swift
+3 −1 Sources/Nimble/Adapters/NMBObjCMatcher.swift
+1 −1 Sources/Nimble/Adapters/NimbleEnvironment.swift
+7 −2 Sources/Nimble/Adapters/NimbleXCTestHandler.swift
+1 −1 Sources/Nimble/Adapters/NonObjectiveC/ExceptionCapture.swift
+23 −5 Sources/Nimble/DSL+Wait.swift
+1 −1 Sources/Nimble/DSL.swift
+66 −5 Sources/Nimble/Expectation.swift
+262 −0 Sources/Nimble/ExpectationMessage.swift
+11 −2 Sources/Nimble/Expression.swift
+27 −0 Sources/Nimble/FailureMessage.swift
+76 −49 Sources/Nimble/Matchers/AllPass.swift
+100 −5 Sources/Nimble/Matchers/AsyncMatcherWrapper.swift
+40 −20 Sources/Nimble/Matchers/BeAKindOf.swift
+29 −23 Sources/Nimble/Matchers/BeAnInstanceOf.swift
+30 −26 Sources/Nimble/Matchers/BeCloseTo.swift
+38 −34 Sources/Nimble/Matchers/BeEmpty.swift
+12 −11 Sources/Nimble/Matchers/BeGreaterThan.swift
+8 −8 Sources/Nimble/Matchers/BeGreaterThanOrEqualTo.swift
+6 −6 Sources/Nimble/Matchers/BeIdenticalTo.swift
+8 −8 Sources/Nimble/Matchers/BeLessThan.swift
+8 −8 Sources/Nimble/Matchers/BeLessThanOrEqual.swift
+24 −30 Sources/Nimble/Matchers/BeLogical.swift
+5 −6 Sources/Nimble/Matchers/BeNil.swift
+2 −2 Sources/Nimble/Matchers/BeVoid.swift
+17 −20 Sources/Nimble/Matchers/BeginWith.swift
+19 −18 Sources/Nimble/Matchers/Contain.swift
+7 −6 Sources/Nimble/Matchers/ContainElementSatisfying.swift
+12 −12 Sources/Nimble/Matchers/EndWith.swift
+87 −48 Sources/Nimble/Matchers/Equal.swift
+9 −7 Sources/Nimble/Matchers/HaveCount.swift
+5 −5 Sources/Nimble/Matchers/Match.swift
+41 −9 Sources/Nimble/Matchers/MatchError.swift
+19 −3 Sources/Nimble/Matchers/MatcherFunc.swift
+24 −23 Sources/Nimble/Matchers/MatcherProtocols.swift
+6 −8 Sources/Nimble/Matchers/PostNotification.swift
+348 −0 Sources/Nimble/Matchers/Predicate.swift
+28 −13 Sources/Nimble/Matchers/RaisesException.swift
+76 −29 Sources/Nimble/Matchers/SatisfyAnyOf.swift
+5 −4 Sources/Nimble/Matchers/ThrowAssertion.swift
+229 −24 Sources/Nimble/Matchers/ThrowError.swift
+37 −0 Sources/Nimble/Matchers/ToSucceed.swift
+39 −23 Sources/Nimble/Utils/Async.swift
+2 −80 Sources/Nimble/Utils/Errors.swift
+1 −1 Sources/Nimble/Utils/Stringers.swift
+3 −3 Sources/NimbleObjectiveC/DSL.h
+6 −6 Sources/NimbleObjectiveC/DSL.m
+2 −2 Sources/NimbleObjectiveC/NMBExceptionCapture.h
+3 −3 Sources/NimbleObjectiveC/NMBExceptionCapture.m
+1 −1 Sources/NimbleObjectiveC/NMBStringify.h
+2 −0 Tests/.swiftlint.yml
+32 −9 Tests/NimbleTests/AsynchronousTest.swift
+1 −1 Tests/NimbleTests/Helpers/XCTestCaseProvider.swift
+16 −14 Tests/NimbleTests/Helpers/utils.swift
+5 −5 Tests/NimbleTests/Matchers/BeAKindOfTest.swift
+6 −6 Tests/NimbleTests/Matchers/BeAnInstanceOfTest.swift
+14 −14 Tests/NimbleTests/Matchers/BeCloseToTest.swift
+2 −2 Tests/NimbleTests/Matchers/BeEmptyTest.swift
+1 −1 Tests/NimbleTests/Matchers/BeGreaterThanOrEqualToTest.swift
+4 −4 Tests/NimbleTests/Matchers/BeIdenticalToTest.swift
+1 −1 Tests/NimbleTests/Matchers/BeLessThanOrEqualToTest.swift
+1 −1 Tests/NimbleTests/Matchers/BeginWithTest.swift
+5 −5 Tests/NimbleTests/Matchers/ContainTest.swift
+1 −1 Tests/NimbleTests/Matchers/EndWithTest.swift
+6 −4 Tests/NimbleTests/Matchers/EqualTest.swift
+1 −0 Tests/NimbleTests/Matchers/MatchErrorTest.swift
+1 −1 Tests/NimbleTests/Matchers/PostNotificationTest.swift
+1 −1 Tests/NimbleTests/Matchers/RaisesExceptionTest.swift
+1 −1 Tests/NimbleTests/Matchers/ThrowAssertionTest.swift
+1 −0 Tests/NimbleTests/Matchers/ThrowErrorTest.swift
+36 −0 Tests/NimbleTests/Matchers/ToSucceedTest.swift
+2 −2 Tests/NimbleTests/SynchronousTests.swift
+7 −7 Tests/NimbleTests/objc/ObjCAllPassTest.m
+4 −4 Tests/NimbleTests/objc/ObjCBeEmptyTest.m
+4 −4 Tests/NimbleTests/objc/ObjCBeGreaterThanTest.m
+4 −4 Tests/NimbleTests/objc/ObjCBeLessThanTest.m
+2 −2 Tests/NimbleTests/objc/ObjCContainTest.m
+2 −2 Tests/NimbleTests/objc/ObjCEqualTest.m
+1 −1 Tests/NimbleTests/objc/ObjCRaiseExceptionTest.m
+2 −1 script/release
+2 −1 test
2 changes: 1 addition & 1 deletion Carthage/Checkouts/Quick
Submodule Quick updated 46 files
+0 −39 .Package.test.swift
+2 −1 .gitignore
+1 −1 .swift-version
+1 −2 .swiftlint.yml
+15 −1 .travis.yml
+1 −1 Documentation/ja/ConfiguringQuick.md
+1 −1 Externals/Nimble
+17 −3 Package.swift
+40 −0 Package@swift-4.swift
+1 −1 Quick.podspec
+83 −32 Quick.xcodeproj/project.pbxproj
+17 −1 Quick.xcodeproj/xcshareddata/xcschemes/Quick-iOS.xcscheme
+17 −1 Quick.xcodeproj/xcshareddata/xcschemes/Quick-macOS.xcscheme
+17 −1 Quick.xcodeproj/xcshareddata/xcschemes/Quick-tvOS.xcscheme
+4 −5 Rakefile
+17 −0 Sources/Quick/Behavior.swift
+14 −1 Sources/Quick/Callsite.swift
+2 −2 Sources/Quick/Configuration/Configuration.swift
+4 −4 Sources/Quick/Configuration/QuickConfiguration.swift
+30 −0 Sources/Quick/DSL/DSL.swift
+33 −3 Sources/Quick/DSL/World+DSL.swift
+1 −1 Sources/Quick/ErrorUtility.swift
+20 −2 Sources/Quick/Example.swift
+5 −9 Sources/Quick/ExampleGroup.swift
+14 −1 Sources/Quick/ExampleMetadata.swift
+14 −1 Sources/Quick/Filter.swift
+1 −1 Sources/Quick/NSBundle+CurrentTestBundle.swift
+2 −2 Sources/Quick/NSString+C99ExtendedIdentifier.swift
+1 −1 Sources/Quick/QuickSelectedTestSuiteBuilder.swift
+2 −2 Sources/Quick/QuickSpec.swift
+6 −6 Sources/Quick/QuickTestSuite.swift
+17 −3 Sources/Quick/World.swift
+2 −2 Sources/QuickSpecBase/include/QuickSpecBase.h
+10 −1 Tests/QuickTests/QuickFocusedTests/FocusedTests.swift
+1 −1 Tests/QuickTests/QuickTestHelpers/XCTestCaseProvider.swift
+20 −0 Tests/QuickTests/QuickTests/Fixtures/FunctionalTests_BehaviorTests_Behaviors.swift
+20 −21 Tests/QuickTests/QuickTests/FunctionalTests/AfterEachTests.swift
+17 −18 Tests/QuickTests/QuickTests/FunctionalTests/BeforeEachTests.swift
+59 −0 Tests/QuickTests/QuickTests/FunctionalTests/BehaviorTests.swift
+1 −1 Tests/QuickTests/QuickTests/FunctionalTests/ContextTests.swift
+2 −2 Tests/QuickTests/QuickTests/FunctionalTests/CrossReferencingSpecs.swift
+1 −1 Tests/QuickTests/QuickTests/FunctionalTests/DescribeTests.swift
+4 −4 Tests/QuickTests/QuickTests/FunctionalTests/ItTests.swift
+1 −1 Tests/QuickTests/QuickTests/FunctionalTests/ObjC/FailureUsingXCTAssertTests+ObjC.m
+8 −1 Tests/QuickTests/QuickTests/FunctionalTests/PendingTests.swift
+2 −2 Tests/QuickTests/QuickTests/FunctionalTests/SharedExamplesTests.swift
2 changes: 1 addition & 1 deletion Carthage/Checkouts/RxSwift
Submodule RxSwift updated 717 files
2 changes: 1 addition & 1 deletion Configurations/Base.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ IPHONEOS_DEPLOYMENT_TARGET = 8.0
WATCHOS_DEPLOYMENT_TARGET = 2.0
TVOS_DEPLOYMENT_TARGET = 9.0

SWIFT_VERSION = 3.0
SWIFT_VERSION = 4.0
6 changes: 3 additions & 3 deletions Demo/Helpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ import RxCocoa
extension CALayer
{
public var rx_position: AnyObserver<CGPoint> {
return UIBindingObserver(UIElement: self) { layer, value in
return Binder(self) { layer, value in
layer.position = value
}.asObserver()
}

public var rx_hidden: AnyObserver<Bool> {
return UIBindingObserver(UIElement: self) { layer, value in
return Binder(self) { layer, value in
layer.isHidden = value
}.asObserver()
}

public var rx_backgroundColor: AnyObserver<CGColor?> {
return UIBindingObserver(UIElement: self) { layer, value in
return Binder(self) { layer, value in
layer.backgroundColor = value
}.asObserver()
}
Expand Down
24 changes: 12 additions & 12 deletions Demo/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class AutomatonViewController: UIViewController
{
return Observable<Int>.interval(interval, scheduler: MainScheduler.instance)
.take(count)
.scan(0) { $0.0 + 1 }
.scan(0) { x, _ in x + 1 }
.startWith(0)
.map {
switch $0 {
Expand Down Expand Up @@ -80,34 +80,34 @@ class AutomatonViewController: UIViewController
.subscribe(onNext: { reply in
print("received reply = \(reply)")
})
.addDisposableTo(_disposeBag)
.disposed(by: _disposeBag)

automaton.state.asObservable()
.subscribe(onNext: { state in
print("current state = \(state)")
})
.addDisposableTo(_disposeBag)
.disposed(by: _disposeBag)

// Setup buttons.
do {
self.loginButton?.rx.tap
.subscribe(onNext: { _ in inputObserver.onNext(.login) })
.addDisposableTo(_disposeBag)
.disposed(by: _disposeBag)

self.logoutButton?.rx.tap
.subscribe(onNext: { _ in inputObserver.onNext(.logout) })
.addDisposableTo(_disposeBag)
.disposed(by: _disposeBag)

self.forceLogoutButton?.rx.tap
.subscribe(onNext: { _ in inputObserver.onNext(.forceLogout) })
.addDisposableTo(_disposeBag)
.disposed(by: _disposeBag)
}

// Setup label.
do {
textSignal
.bindTo(self.label!.rx.text)
.addDisposableTo(_disposeBag)
.bind(to: self.label!.rx.text)
.disposed(by: _disposeBag)
}

// Setup Pulsator.
Expand All @@ -121,19 +121,19 @@ class AutomatonViewController: UIViewController
.map(_pulsatorColor)
.map { $0.cgColor }
.drive(pulsator.rx_backgroundColor)
.addDisposableTo(_disposeBag)
.disposed(by: _disposeBag)

automaton.state.asDriver()
.map(_pulsatorPosition)
.drive(pulsator.rx_position)
.addDisposableTo(_disposeBag)
.disposed(by: _disposeBag)

// Overwrite the pulsator color to red if `.forceLogout` succeeded.
automaton.replies
.filter { $0.toState != nil && $0.input == .forceLogout }
.map { _ in UIColor.red.cgColor }
.bindTo(pulsator.rx_backgroundColor)
.addDisposableTo(_disposeBag)
.bind(to: pulsator.rx_backgroundColor)
.disposed(by: _disposeBag)
}

}
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ let package = Package(
name: "RxAutomaton",
dependencies: {
var deps: [Package.Dependency] = [
.Package(url: "https://github.com/ReactiveX/RxSwift.git", majorVersion: 3)
.Package(url: "https://github.com/ReactiveX/RxSwift.git", majorVersion: 4)
]
if isSwiftPackageManagerTest {
deps += [
.Package(url: "https://github.com/Quick/Quick", majorVersion: 1),
.Package(url: "https://github.com/Quick/Nimble", majorVersion: 6)
.Package(url: "https://github.com/Quick/Nimble", majorVersion: 7)
]
}
return deps
Expand Down
2 changes: 1 addition & 1 deletion RxAutomaton.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ Pod::Spec.new do |s|
s.source = { :git => "https://github.com/inamiy/RxAutomaton.git", :tag => "#{s.version}" }
s.source_files = "Sources/**/*.swift"

s.dependency "RxSwift", "~> 3.0"
s.dependency "RxSwift", "~> 4.0"
end
16 changes: 15 additions & 1 deletion RxAutomaton.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0810;
LastUpgradeCheck = 0900;
ORGANIZATIONNAME = "Yasuhiro Inami";
TargetAttributes = {
488738DB1D61689000BF70F4 = {
Expand Down Expand Up @@ -518,14 +518,20 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand All @@ -551,6 +557,7 @@
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand All @@ -567,14 +574,20 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand All @@ -593,6 +606,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0810"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,6 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand Down Expand Up @@ -55,6 +56,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
16 changes: 8 additions & 8 deletions Sources/Automaton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ public final class Automaton<State, Input>
{
return Observable<Input>.create { observer in
let mappingSignal = inputProducer
.withLatestFrom(stateProperty.asObservable()) { $0 }
.withLatestFrom(stateProperty.asObservable()) { ($0, $1) }
.map { input, fromState in
return (input, fromState, mapping(fromState, input)?.1)
}
.shareReplay(1)
.share(replay: 1)

let successSignal = mappingSignal
.filterMap { input, fromState, effect in
Expand All @@ -101,7 +101,7 @@ public final class Automaton<State, Input>
}

let replySignal = recurInputProducer(inputSignal, strategy: strategy)
.withLatestFrom(stateProperty.asObservable()) { $0 }
.withLatestFrom(stateProperty.asObservable()) { ($0, $1) }
.flatMap(.merge) { input, fromState -> Observable<Reply<State, Input>> in
if let (toState, _) = mapping(fromState, input) {
return .just(.success(input, fromState, toState))
Expand All @@ -110,7 +110,7 @@ public final class Automaton<State, Input>
return .just(.failure(input, fromState))
}
}
.shareReplay(1)
.share(replay: 1)

replySignal
.flatMap(.merge) { reply -> Observable<State> in
Expand All @@ -122,11 +122,11 @@ public final class Automaton<State, Input>
}
}
.bindTo(stateProperty)
.addDisposableTo(_disposeBag)
.disposed(by: _disposeBag)

replySignal
.subscribe(self._replyObserver)
.addDisposableTo(_disposeBag)
.disposed(by: _disposeBag)
}

deinit
Expand All @@ -137,9 +137,9 @@ public final class Automaton<State, Input>

// MARK: Private

private func _compose<A, B, C>(_ g: @escaping (B) -> C, _ f: @escaping (A) -> B) -> (A) -> C
private func _compose<A, B, C, D>(_ g: @escaping ((C) -> D), _ f: @escaping ((A, B) -> C)) -> ((A, B) -> D)
{
return { x in g(f(x)) }
return { x, y in g(f(x, y)) }
}

private func _toEffectMapping<State, Input>(toState: State?) -> (State, Observable<Input>)?
Expand Down
8 changes: 4 additions & 4 deletions Tests/RxAutomatonTests/Fixtures/ToRACHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@ extension ObservableType {

extension ObservableType {
@discardableResult
final func observeValues(_ next: @escaping (E) -> Void) -> Disposable {
func observeValues(_ next: @escaping (E) -> Void) -> Disposable {
return self.subscribe(onNext: next)
}

@discardableResult
final func observe(_ observer: @escaping (Event<E>) -> Void) -> Disposable {
func observe(_ observer: @escaping (Event<E>) -> Void) -> Disposable {
return self.subscribe(AnyObserver(eventHandler: observer))
}
}

extension ObserverType {
final func send(next value: E) {
func send(next value: E) {
self.onNext(value)
}

final func sendCompleted() {
func sendCompleted() {
self.onCompleted()
}
}
Expand Down

0 comments on commit 44f4999

Please sign in to comment.