Refactor account reducer

This commit is contained in:
Alex Gleason 2020-07-04 19:37:07 -05:00
parent a83f785b73
commit 15998abf89
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -8,13 +8,13 @@ import { Map as ImmutableMap, fromJS } from 'immutable';
const initialState = ImmutableMap();
const normalizeAccount = (state, account) => {
account = { ...account };
const normalized = fromJS(account).deleteAll([
'followers_count',
'following_count',
'statuses_count',
]);
delete account.followers_count;
delete account.following_count;
delete account.statuses_count;
return state.set(account.id, fromJS(account));
return state.set(account.id, normalized);
};
const normalizeAccounts = (state, accounts) => {