Skip to content

Commit

Permalink
Fix #7378: Renaming result variable into accumulator
Browse files Browse the repository at this point in the history
  • Loading branch information
Julie Philip James authored and jpjjulie committed Oct 18, 2019
1 parent 4b3c6b9 commit 37b1dba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions packages/block-editor/src/store/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ function mapBlockOrder( blocks, rootClientId = '' ) {
* @return {Object} Block order map object.
*/
function mapBlockParents( blocks, rootClientId = '' ) {
return blocks.reduce( ( resultAccumulator, block ) => Object.assign(
resultAccumulator,
return blocks.reduce( ( accumulator, block ) => Object.assign(
accumulator,
{ [ block.clientId ]: rootClientId },
mapBlockParents( block.innerBlocks, block.clientId )
), {} );
Expand Down Expand Up @@ -202,9 +202,9 @@ export function isUpdatingSameBlockAttribute( action, lastAction ) {
* @return {Object} Object filled with empty object as values for each clientId.
*/
const fillKeysWithEmptyObject = ( objectKeys ) => {
return objectKeys.reduce( ( resultAccumulator, key ) => {
resultAccumulator[ key ] = {};
return resultAccumulator;
return objectKeys.reduce( ( accumulator, key ) => {
accumulator[ key ] = {};
return accumulator;
}, {} );
};

Expand Down Expand Up @@ -237,13 +237,13 @@ const withBlockCache = ( reducer ) => ( state = {}, action ) => {
* @return {Array} The provided clientIds and all of their parent clientIds.
*/
const getBlocksWithParentsClientIds = ( clientIds ) => {
return clientIds.reduce( ( resultAccumulator, clientId ) => {
return clientIds.reduce( ( accumulator, clientId ) => {
let current = clientId;
do {
resultAccumulator.push( current );
accumulator.push( current );
current = state.parents[ current ];
} while ( current );
return resultAccumulator;
return accumulator;
}, [] );
};

Expand Down
8 changes: 4 additions & 4 deletions packages/data/src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ function createCoreDataStore( registry ) {
'hasFinishedResolution',
'isResolving',
'getCachedResolvers',
].reduce( ( memoAccumulator, selectorName ) => ( {
...memoAccumulator,
].reduce( ( accumulator, selectorName ) => ( {
...accumulator,
[ selectorName ]: getCoreDataSelector( selectorName ),
} ), {} );
},
Expand All @@ -29,8 +29,8 @@ function createCoreDataStore( registry ) {
'invalidateResolution',
'invalidateResolutionForStore',
'invalidateResolutionForStoreSelector',
].reduce( ( memoAccumulator, actionName ) => ( {
...memoAccumulator,
].reduce( ( accumulator, actionName ) => ( {
...accumulator,
[ actionName ]: getCoreDataAction( actionName ),
} ), {} );
},
Expand Down

0 comments on commit 37b1dba

Please sign in to comment.