diff options
author | Sorin Davidoi <sorin.davidoi@gmail.com> | 2017-07-11 01:00:14 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-07-11 01:00:14 +0200 |
commit | cc68d1945b42459a787e0ce216e8f49393eeb197 (patch) | |
tree | 1c01481aa4dec6b60bafb15e119c36498d5a1d27 /app/javascript/mastodon/reducers/accounts_counters.js | |
parent | 7bacdd718a143f54f47ddc3afa39504636be65c0 (diff) |
refactor: Rewrite immutablejs import statements using destructuring (#4147)
Diffstat (limited to 'app/javascript/mastodon/reducers/accounts_counters.js')
-rw-r--r-- | app/javascript/mastodon/reducers/accounts_counters.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/javascript/mastodon/reducers/accounts_counters.js b/app/javascript/mastodon/reducers/accounts_counters.js index eb8a4f83d..4423e1b50 100644 --- a/app/javascript/mastodon/reducers/accounts_counters.js +++ b/app/javascript/mastodon/reducers/accounts_counters.js @@ -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'), |