title: How to create a map of records from a javascript raw object with Immutable.js?
body: <p>I'm new to immutable.js and I'd like to understand better how to use records starting from a raw JS object. </p>
  
  <p>With <code>Immutable.fromJS()</code> I can create a map passing a raw object, for example:</p>
  
  <pre><code>var images = {
     "1": {
      id: "1",
      urls: ["/medium/1.jpg", "/large/1.jpg"]
     },
     "2": {
      id: "2",
      urls: ["/medium/1.jpg", "/large/1.jpg"]
     }
    }
  
  var imagesMap = Immutable.fromJS(images);
  </code></pre>
  
  <p><code>imagesMap</code> is now a map containing other maps, one for each image.</p>
  
  <p>I'd like instead to create a map containing records, for example using a <code>Image</code> record defined as:</p>
  
  <pre><code>var ImageRecord = Immutable.Record({ id: undefined, urls: undefined })
  </code></pre>
  
  <p>How can I have <code>imagesMap</code> as map of <code>ImageRecord</code>s? Is something I can do passing a reviver to <code>fromJS</code>, or should I go with the "old" approach?</p>
  
  <pre><code>// old approach
  var imagesMap = Immutable.Map()
  for (key in images) {
     imagesMap.set(key, new ImageRecord(images[key]))
  }
  </code></pre>