Import only lodash set and defaults deep
This commit is contained in:
committed by
Adam Butterworth
parent
a3b7999627
commit
2efdc78ace
@@ -1,3 +1,5 @@
|
||||
import defaultsDeep from 'lodash.defaultsdeep';
|
||||
|
||||
import {
|
||||
FETCH_PREFERENCES,
|
||||
SAVE_PREFERENCES,
|
||||
@@ -41,10 +43,10 @@ const profile = (state = initialState, action) => {
|
||||
savePreferencesState: 'pending',
|
||||
};
|
||||
case SAVE_PREFERENCES.SUCCESS:
|
||||
// defaults deep used because our preferences/state object is multi-dimensional
|
||||
return {
|
||||
...state,
|
||||
...defaultsDeep({}, action.preferences, state),
|
||||
savePreferencesState: 'complete',
|
||||
...action.preferences,
|
||||
};
|
||||
case SAVE_PREFERENCES.FAILURE:
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user