I've found that it is best to make the `setState` call as simple as possible. I would remove the function calls from the `setState` call, do all the calculations before and pass a simple object literal.    Also, don't call `NotificationsStore.getNotifications()` twice. Cache the result of the first call.    `NotificationsStore.getNotifications()` returns an object of arrays of notifications. You have to do your calculations on the underlying arrays.