Home / Companies / Netlify / Blog / Post Details
Content Deep Dive

Grouping Immutable Deploy Data

Blog post from Netlify

Post Details
Company
Date Published
Author
Brian Douglas
Word Count
797
Language
English
Hacker News Points
-
Summary

The developer at Netlify updated the deploys page by grouping deploy data by date using Immutable.js. The data was coming from an API that didn't group it by date, but Redux and Immutable.js allowed for immutability of state to be maintained. The reducer function `groupByDate()` was created to group similar deploys with the created_at date as the key, using the `reduce()` function available in Immutable Lists. This resulted in a new data structure that made it easier to display the deploy data by date. The developer used JSX to map over the grouped deploy data and render it on the page.