glenjamin / glenjamin/transit-immutable-js
Serializing es6 classes by calling toJSON
- Dominant language
- JavaScript
- Stars
- 250
- Forks
- 27
- PR merge metrics
- No merged PRs in 30d
Description
I wish I could put my redux state as is to the toJSON method without worrying that all data structures inside have to belong to immutable.js. Maybe I'm missing something, but at the moment I'm getting an error when I try to serialize Map, where Item is a basic class with a constructor.
The thing is that JSON.stringify does the job of serializing es6 classes just fine by only including it's properties and ignoring methods. I would expect that the library would handle non-immutable objects the same way as JSON.stringify does - then it would be a nice neat extension for normal serialization.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.