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

Does not work with Javascript Maps #171

Open
noahehall opened this issue Nov 14, 2016 · 9 comments
Open

Does not work with Javascript Maps #171

noahehall opened this issue Nov 14, 2016 · 9 comments

Comments

@noahehall
Copy link

noahehall commented Nov 14, 2016

I am using a javacript map to store data I retrieve from an api for a udacity project.

However, the data is not being saved to the immutable object.

here is a branch you can clone and verify:

  1. clone https://github.com/noahehall/udacity-trainschedule/tree/serviceworkers
  2. npm install
  3. npm run start

here is picture of implementation
screen shot 2016-11-13 at 9 51 18 pm

here is picture of error received from immutable
screen shot 2016-11-13 at 9 53 16 pm
error TypeError: immutableDoesNotWorkWithJavascriptMaps.data.has is not a function(…)

Is there a workaround to get immutable to use Javascript maps? am i doing something wrong (very likely...)? or should I abandon seamless immutable?

@noahehall noahehall changed the title Does not work with Javascript keyed collection Map Does not work with Javascript Maps Nov 14, 2016
@noahehall
Copy link
Author

hmm ive actually switched form using Maps with seamless-immutable, but will be interested to know if they will be supported in the future

@rtfeldman
Copy link
Owner

Happy to accept a PR for them!

@noahehall
Copy link
Author

Definitely, ill take a swing at it. I switched to storing everything as an object for now

@gavin-gmlab
Copy link

I'm having this problem also.

Seems like a .set still works, but a .get does not get the object back properly.

Tried a workaround to create a new map object => newMap = new Map(state.oldMap._mapData) seems to work. Not sure if there are other implications

@noahehall
Copy link
Author

yeah sorry guys still havent had time to work on this, things at work have been crazy

@noahehall
Copy link
Author

Finally got some time, picking this up ;)

@noahehall
Copy link
Author

noahehall commented Feb 8, 2017

so i got drunk last night and worked on integrating maps,

you can see a preview here:
#198

i'll need to do some clean up and refacter it a bit, add some tests, then ill drop the WIP tag from the pull request

@mikeaustin
Copy link

Soo.. are Maps and Sets supported now? I'd digging around trying to find out.

@tedlin182
Copy link

@noahehall Any progress on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants