Rename variables to have semantic meanings in notifications reducer (#6890)
This commit is contained in:
		
				
					committed by
					
						
						Eugen Rochko
					
				
			
			
				
	
			
			
			
						parent
						
							fe398a098e
						
					
				
				
					commit
					59657e24b9
				
			@@ -49,11 +49,11 @@ const normalizeNotification = (state, notification) => {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const normalizeNotifications = (state, notifications, next) => {
 | 
					const normalizeNotifications = (state, notifications, next) => {
 | 
				
			||||||
  let items    = ImmutableList();
 | 
					  let newItems    = ImmutableList();
 | 
				
			||||||
  const loaded = state.get('loaded');
 | 
					  const loaded = state.get('loaded');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  notifications.forEach((n, i) => {
 | 
					  notifications.forEach((n, i) => {
 | 
				
			||||||
    items = items.set(i, notificationToMap(n));
 | 
					    newItems = newItems.set(i, notificationToMap(n));
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (state.get('next') === null) {
 | 
					  if (state.get('next') === null) {
 | 
				
			||||||
@@ -61,7 +61,7 @@ const normalizeNotifications = (state, notifications, next) => {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return state
 | 
					  return state
 | 
				
			||||||
    .update('items', list => loaded ? items.concat(list) : list.concat(items))
 | 
					    .update('items', oldItems => loaded ? newItems.concat(oldItems) : oldItems.concat(newItems))
 | 
				
			||||||
    .set('loaded', true)
 | 
					    .set('loaded', true)
 | 
				
			||||||
    .set('isLoading', false);
 | 
					    .set('isLoading', false);
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user