Skip to content

Serializing es6 classes by calling toJSONΒ #37

@Parez

Description

@Parez

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<string, Item>, 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions