Transforming Immutable.js List of Maps to a List of Lists and then using this as data for google charts
<p>I am trying to use the google charts library to plot some time series data which at the moment is some dummy data I pasted into a separate file from my app.</p>

<p>I have an Immutable <code>List</code> looking something like this :</p>

<pre><code>let data = [{"Date":1452457976,"Value":246.712065},{"Date":1452457990,"Value":268.240542}]
</code></pre>

<p>I'm trying to convert this to a plain javascript array of arrays, each containing a <code>Date</code> object and a value as follows. </p>

<pre><code>let row_data = data.map( (list_object) =&gt; {
    let temp_list = Immutable.List();
    temp_list = temp_list.push(new Date(list_object.get('Date')));
    temp_list = temp_list.push(list_object.get('Value');
    return temp_list;
});

export default row_data.toJS();
</code></pre>

<p>I'm using this exported value as the input for constructing the data-table for a google chart using the <a href="https://github.com/RakanNimer/react-google-charts" rel="nofollow">react-google-charts</a> library. The result is that the section of the page has empty content and with nothing rendered without and no errors logged.</p>

<pre><code>import row_data from 'data';

let options = {...};

let rows = row_data;

let columns = [
    {
        'type': 'date',
        'name': 'Date'
    },
    {
        'type': 'number',
        'name': 'Latency'
    }
]

this.setState({
    'rows': rows,
    'columns': columns,
    'options': options
});
</code></pre>

<p>Digging into the stacktrace, it looks like the argument being passed as rows is not of the type array, even though logging the variable gives me the following : <code>Array[&lt;length&gt;]</code> .</p>

<p>I feel like the way I am doing the immutable transformations are very hacky as I just started using the library today. Please do let me know if there is a better way to approach this.</p>