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

Support for Map #19

Merged
merged 4 commits into from
Jul 27, 2016
Merged

Support for Map #19

merged 4 commits into from
Jul 27, 2016

Conversation

davecoates
Copy link
Member

Add test cases and minor fixes to existing map impl.

Test cases are based on the ones from Immutable.js with some extras around types. All test cases currently passing but didn't have to do much (eg. no custom implementation of map() like in List). Not sure if I'm missing something but seems to do what's expected currently - let me know if there's anything I've missed.

Resolves #9

@davecoates
Copy link
Member Author

Any chance you would have time to look at this sometime soon?

Are you looking for help maintaining this project? I'd be happy to help out however I can

@udnisap
Copy link
Contributor

udnisap commented Apr 18, 2016

Thanks for the implementation.

@lukesneeringer
Copy link
Contributor

Is there any chance of this being merged? I also would like to use it.

@Gozala
Copy link
Collaborator

Gozala commented Jun 23, 2016

Unfortunately I am no longer able to maintain this project, I apologize. If someone wishes to step up and take leadership of this project please respond to #21

@lukesneeringer
Copy link
Contributor

@davecoates asked in #21 for a review of this pull request. I wanted to mention that I have been using it in production for a month now, and it works. :-)

@stutrek
Copy link
Member

stutrek commented Jul 13, 2016

👍

I feel weird hitting the button on this, is everyone ok with it? Looking at you @udnisap?

@davecoates
Copy link
Member Author

I have realised there's one problem with this - the way it handles map. Currently it will throw an error if you return anything other than the type specified whereas it should probably do what List does and return a new typed map based on what you return.

eg. if it was a Map(number, Record({id: Number})) and you did instance.map(record => record.id) the return type would be Map(number, number)

I'll hopefully look at this soon

@stutrek
Copy link
Member

stutrek commented Jul 19, 2016

@davecoates I think I understand what you're saying, that the .map in your comment would error, if that's the case I think we should merge this because I would expect that to error anyway. If you want to play with it some more we can leave this open, but I want to release a new minor version soon.

@davecoates
Copy link
Member Author

Sure, happy to continue looking into this as a separate request.

Regarding map - it's more to be consistent with the behaviour of lists, see https://github.com/typed-immutable/typed-immutable#mapping-lists-form-one-type-to-other

@stutrek
Copy link
Member

stutrek commented Jul 20, 2016

I misinterpreted your comment, I see what you're saying. It looks like there's something going on with the TypeInferer that you might be able to abstract out.

Speaking of the readme, there is one huge thing this is missing -- documentation. Just stating that it exists would be a huge win.

@davecoates
Copy link
Member Author

Ah yes, forgot about readme! I've updated it now basic overview of it.

@lukesneeringer
Copy link
Contributor

lukesneeringer commented Jul 27, 2016

@davecoates Can you merge master into this branch and push so Travis can pick it up?

@davecoates
Copy link
Member Author

👍

@lukesneeringer
Copy link
Contributor

@davecoates Sorry, one more thing. You need to merge the latest changes from master into your branch. As soon as you have done that, I will merge.

Test cases copied from immutable where appropriate with necessary
changes and some type specific tests.

Added failing cases for map and filter (destructive to original data)
@davecoates
Copy link
Member Author

sorry that was my bad, I had rebased but neglected to do it from upstream

@lukesneeringer lukesneeringer merged commit 3ce7f0e into typed-immutable:master Jul 27, 2016
@lukesneeringer
Copy link
Contributor

🎉

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.

Support for Map
5 participants