Use Immutable Record for accounts in Redux state (#26559)
		
	This commit is contained in:
		
					parent
					
						
							
								9d799d40ba
							
						
					
				
			
			
				commit
				
					
						3bf2a7296e
					
				
			
		
					 65 changed files with 765 additions and 662 deletions
				
			
		|  | @ -3,7 +3,7 @@ import { Map as ImmutableMap, OrderedSet as ImmutableOrderedSet } from 'immutabl | |||
| import { | ||||
|   DOMAIN_BLOCKS_FETCH_SUCCESS, | ||||
|   DOMAIN_BLOCKS_EXPAND_SUCCESS, | ||||
|   DOMAIN_UNBLOCK_SUCCESS, | ||||
|   unblockDomainSuccess | ||||
| } from '../actions/domain_blocks'; | ||||
| 
 | ||||
| const initialState = ImmutableMap({ | ||||
|  | @ -18,8 +18,8 @@ export default function domainLists(state = initialState, action) { | |||
|     return state.setIn(['blocks', 'items'], ImmutableOrderedSet(action.domains)).setIn(['blocks', 'next'], action.next); | ||||
|   case DOMAIN_BLOCKS_EXPAND_SUCCESS: | ||||
|     return state.updateIn(['blocks', 'items'], set => set.union(action.domains)).setIn(['blocks', 'next'], action.next); | ||||
|   case DOMAIN_UNBLOCK_SUCCESS: | ||||
|     return state.updateIn(['blocks', 'items'], set => set.delete(action.domain)); | ||||
|   case unblockDomainSuccess.type: | ||||
|     return state.updateIn(['blocks', 'items'], set => set.delete(action.payload.domain)); | ||||
|   default: | ||||
|     return state; | ||||
|   } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue