diff --git a/Example/Sources/CounterViewController.swift b/Example/Sources/CounterViewController.swift index a1b519e..3b8e7c9 100644 --- a/Example/Sources/CounterViewController.swift +++ b/Example/Sources/CounterViewController.swift @@ -36,7 +36,7 @@ private extension CounterViewController { store.computed.command .observe(on: .mainThread) - .subscribe(duringScopeOf: self) { [unowned self] command in + .observe(duringScopeOf: self) { [unowned self] command in switch command { case .openGitHub: guard let url = URL(string: "https://github.com/ra1028/VueFlux") else { return } diff --git a/VueFluxReactive/Signal.swift b/VueFluxReactive/Signal.swift index 2fa2a8c..893436c 100644 --- a/VueFluxReactive/Signal.swift +++ b/VueFluxReactive/Signal.swift @@ -31,7 +31,7 @@ public struct Signal { /// /// - Returns: A disposable to unregister given observer. @discardableResult - func observe(duringScopeOf object: AnyObject, _ observer: @escaping (Value) -> Void) -> Disposable { + public func observe(duringScopeOf object: AnyObject, _ observer: @escaping (Value) -> Void) -> Disposable { let disposable = observe(observer) DisposableScope.associated(with: object) += disposable return disposable @@ -44,7 +44,7 @@ public struct Signal { /// /// - Returns: A disposable to unbind given binder. @discardableResult - func bind(to binder: Binder) -> Disposable { + public func bind(to binder: Binder) -> Disposable { return binder.bind(signal: self) } @@ -56,7 +56,7 @@ public struct Signal { /// /// - Returns: A disposable to unbind given target. @discardableResult - func bind(to target: Target, binding: @escaping (Target, Value) -> Void) -> Disposable { + public func bind(to target: Target, binding: @escaping (Target, Value) -> Void) -> Disposable { return bind(to: .init(target: target, binding: binding)) } @@ -68,7 +68,7 @@ public struct Signal { /// /// - Returns: A disposable to unbind given target. @discardableResult - func bind(to target: Target, _ keyPath: ReferenceWritableKeyPath) -> Disposable { + public func bind(to target: Target, _ keyPath: ReferenceWritableKeyPath) -> Disposable { return bind(to: target) { target, value in target[keyPath: keyPath] = value } @@ -82,7 +82,7 @@ public struct Signal { /// /// - Returns: A disposable to unbind given target. @discardableResult - func bind(to target: Target, _ keyPath: ReferenceWritableKeyPath) -> Disposable { + public func bind(to target: Target, _ keyPath: ReferenceWritableKeyPath) -> Disposable { return bind(to: target) { target, value in target[keyPath: keyPath] = value as Value? }