Skip to content

Latest commit

 

History

History
3 lines (2 loc) · 455 Bytes

File metadata and controls

3 lines (2 loc) · 455 Bytes

Serializing models to plain-JS

It can be useful to convert ImmutableModel instances to plain JS objects. This can be done by calling the toJS instance method. This will return an object of that model's ModelType. This means that immutable Lists and Maps will be converted to plain JS Arrays and Objects, respectively. Nested models will be converted to their plain-JS ModelType representation, even if they are contains within immutable collections.