Refactor account reducer

tl-language-filters
Alex Gleason 2020-07-04 19:37:07 -05:00
rodzic a83f785b73
commit 15998abf89
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 6 dodań i 6 usunięć

Wyświetl plik

@ -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) => {