February 2019
Intermediate to advanced
204 pages
4h 52m
English
Let's consider a plain JavaScript object, holding simple information, like a name and a parent's name. The following snippet shows how we define the person object in normal JavaScript:
import { fromJS } from 'immutable'; // Normal Javascriptconst person = { name: 'Yoshmi Mukhiya', parents: [ { type: "Mother", name: "Anju Mukhiya", }, { type: "Father", name: "Suresh Kumar Mukhiya" } ]};const immutablePerson = fromJS(person);
We can use fromJS to convert any normal JavaScript to immutable JS.
Read now
Unlock full access