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

[POC] Add convenient Disposable.dispose(whenEnded lifetime: Lifetime) #475

Closed
wants to merge 3 commits into from

Conversation

ikesyo
Copy link
Member

@ikesyo ikesyo commented Jul 6, 2017

#421 (comment)

I'd like to have feedbacks.

Checklist

  • Updated CHANGELOG.md.

@ikesyo ikesyo added the proposal label Jul 6, 2017
@andersio
Copy link
Member

andersio commented Jul 6, 2017

It looks natural, but .bind(to:) is kinda misleading in the context. I would suggest dispose(when:).

@ikesyo
Copy link
Member Author

ikesyo commented Jul 6, 2017

Hmm using the same word dispose may be a bit confusing:

producer.start().dispose()
// versus
producer.start().dispose(when: lifetime)

@andersio
Copy link
Member

andersio commented Jul 6, 2017

I think it is a reasonable mental model. If you don't specify anything, it is disposed of immediately. If you specify whenEnded, it is disposed of at a certain point in the future.

@ikesyo
Copy link
Member Author

ikesyo commented Jul 6, 2017

whenEnded sounds good (over just when).

@ikesyo ikesyo changed the title [POC] Add convenient Disposable.bind(to lifetime: Lifetime) method [POC] Add convenient Disposable.dispose(whenEnded lifetime: Lifetime) method Jul 6, 2017
@ikesyo ikesyo changed the title [POC] Add convenient Disposable.dispose(whenEnded lifetime: Lifetime) method [POC] Add convenient Disposable.dispose(whenEnded lifetime: Lifetime) Jul 6, 2017
@sharplet
Copy link
Contributor

sharplet commented Jul 6, 2017

What about dispose(atEndOf: lifetime)?

@mdiep
Copy link
Contributor

mdiep commented Jul 11, 2017

Do you think this is still needed now that += is back?

@ikesyo
Copy link
Member Author

ikesyo commented Jul 11, 2017

I'm happy with += so withdraw this.

@ikesyo ikesyo closed this Jul 11, 2017
@ikesyo ikesyo deleted the disposable-bind-to-lifetime branch July 11, 2017 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants