Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename times to repeat. #119

Merged
merged 2 commits into from
Nov 28, 2016
Merged

Rename times to repeat. #119

merged 2 commits into from
Nov 28, 2016

Conversation

andersio
Copy link
Member

Related issue: #118

@@ -279,6 +288,18 @@ extension SignalProducerProtocol {

@available(*, unavailable, message:"This SignalProducer may emit errors which must be handled explicitly, or observed using `startWithResult(_:)`.")
public func startWithNext(_ next: (Value) -> Void) -> Disposable { fatalError() }

@available(*, unavailable, renamed:"repeat(_:)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree repeat is better.

@@ -207,6 +207,15 @@ extension SignalProtocol {

@available(*, unavailable, message: "This Signal may emit errors which must be handled explicitly, or observed using `observeResult(_:)`")
public func observeNext(_ next: (Value) -> Void) -> Disposable? { fatalError() }

@available(*, unavailable, renamed:"catch(_:)")
public func flatMapError<F>(_ handler: @escaping (Error) -> SignalProducer<Value, F>) -> Signal<Value, F> { fatalError() }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flatMapError is far more descriptive. catch is a well known word but it doesn't carry the extra information that this does, which draws a parallel with flatMap.

public func attempt(_ operation: @escaping (Value) -> Result<(), Error>) -> Signal<Value, Error> { fatalError() }

@available(*, unavailable, renamed:"tryMap(_:)")
public func attemptMap<U>(_ operation: @escaping (Value) -> Result<U, Error>) -> Signal<U, Error> { fatalError() }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These names are meant to match the Result counterparts.

Copy link
Member

@NachoSoto NachoSoto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer repeat, but I think the others are better.

@andersio andersio changed the title API renaming: catch, try and repeat. Rename times to repeat. Nov 27, 2016
@@ -1,5 +1,5 @@
import Foundation
import enum Result.NoError
import Result
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be reverted too?

@andersio andersio merged commit 331b711 into master Nov 28, 2016
@andersio andersio deleted the api-rename branch November 28, 2016 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants