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

Overload map() to support key paths #435

Merged
merged 1 commit into from
Jun 9, 2017
Merged

Overload map() to support key paths #435

merged 1 commit into from
Jun 9, 2017

Conversation

sharplet
Copy link
Contributor

@sharplet sharplet commented Jun 7, 2017

We should be able to use key paths with flatMap() too, but this is a start.

  • Updated CHANGELOG.md.

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.

Wohoo

#if swift(>=3.2)
it("should work with key paths") {
let property = MutableProperty("foo")
let mappedProperty = property.map(\.count)
Copy link
Member

Choose a reason for hiding this comment

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

LOVE IT

@mdiep
Copy link
Contributor

mdiep commented Jun 7, 2017

KeyPaths are the best thing ever. 💖

@andersio
Copy link
Member

andersio commented Jun 7, 2017

(Irrelevant to this PR) I hope the Swift gurus manage to get key path decomposition into 4.0. With it we can make MutableProperty capable of doing automatic KVO.

🙀🙀🙀🙀🙀🙀🙀

@mdiep
Copy link
Contributor

mdiep commented Jun 7, 2017

I don't think these tests are actually going to run on CI right now. But since we've updated Nimble, we should be able to run swift test with Swift 4 on CI.

@ikesyo ikesyo mentioned this pull request Jun 7, 2017
@sharplet
Copy link
Contributor Author

sharplet commented Jun 7, 2017

Happy to wait for #436 and rebase.

@sharplet
Copy link
Contributor Author

sharplet commented Jun 7, 2017

or #437 😂

@sharplet
Copy link
Contributor Author

sharplet commented Jun 9, 2017

Ready to go 👍

@mdiep mdiep merged commit 1476acd into master Jun 9, 2017
@mdiep mdiep deleted the as-map-keypath branch June 9, 2017 00:22
@mdiep
Copy link
Contributor

mdiep commented Jun 9, 2017

🎉

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