refactor: Rewrite immutablejs import statements using destructuring (#4147)
This commit is contained in:
committed by
Eugen Rochko
parent
7bacdd718a
commit
cc68d1945b
@ -46,9 +46,9 @@ import {
|
||||
FAVOURITED_STATUSES_EXPAND_SUCCESS,
|
||||
} from '../actions/favourites';
|
||||
import { STORE_HYDRATE } from '../actions/store';
|
||||
import Immutable from 'immutable';
|
||||
import { Map as ImmutableMap, fromJS } from 'immutable';
|
||||
|
||||
const normalizeAccount = (state, account) => state.set(account.id, Immutable.fromJS({
|
||||
const normalizeAccount = (state, account) => state.set(account.id, fromJS({
|
||||
followers_count: account.followers_count,
|
||||
following_count: account.following_count,
|
||||
statuses_count: account.statuses_count,
|
||||
@ -80,12 +80,12 @@ const normalizeAccountsFromStatuses = (state, statuses) => {
|
||||
return state;
|
||||
};
|
||||
|
||||
const initialState = Immutable.Map();
|
||||
const initialState = ImmutableMap();
|
||||
|
||||
export default function accountsCounters(state = initialState, action) {
|
||||
switch(action.type) {
|
||||
case STORE_HYDRATE:
|
||||
return state.merge(action.state.get('accounts').map(item => Immutable.fromJS({
|
||||
return state.merge(action.state.get('accounts').map(item => fromJS({
|
||||
followers_count: item.get('followers_count'),
|
||||
following_count: item.get('following_count'),
|
||||
statuses_count: item.get('statuses_count'),
|
||||
|
Reference in New Issue
Block a user