Skip to content

Commit

Permalink
Block Editor: Rename getLastBlockAttributesChange to getLastBlockAttr…
Browse files Browse the repository at this point in the history
…ibuteChanges
  • Loading branch information
aduth committed Jul 10, 2019
1 parent 8516fd1 commit 37a7ba9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/block-editor/src/store/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -1391,7 +1391,7 @@ export function __unstableIsLastBlockChangeIgnored( state ) {
* @return {Object<string,Object>} Subsets of block attributes changed, keyed
* by block client ID.
*/
export function __experimentalGetLastBlockAttributesChange( state ) {
export function __experimentalGetLastBlockAttributeChanges( state ) {
return state.lastBlockAttributesChange;
}

Expand Down
6 changes: 3 additions & 3 deletions packages/block-editor/src/store/test/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const {
getTemplate,
getTemplateLock,
getBlockListSettings,
__experimentalGetLastBlockAttributesChange,
__experimentalGetLastBlockAttributeChanges,
INSERTER_UTILITY_HIGH,
INSERTER_UTILITY_MEDIUM,
INSERTER_UTILITY_LOW,
Expand Down Expand Up @@ -2440,15 +2440,15 @@ describe( 'selectors', () => {
} );
} );

describe( '__experimentalGetLastBlockAttributesChange', () => {
describe( '__experimentalGetLastBlockAttributeChanges', () => {
it( 'returns the last block attributes change', () => {
const state = {
lastBlockAttributesChange: {
block1: { fruit: 'bananas' },
},
};

const result = __experimentalGetLastBlockAttributesChange( state );
const result = __experimentalGetLastBlockAttributeChanges( state );

expect( result ).toEqual( {
block1: { fruit: 'bananas' },
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ export function unlockPostSaving( lockName ) {
* @return {Object} Action object
*/
export function* resetEditorBlocks( blocks, options = {} ) {
const lastBlockAttributesChange = yield select( 'core/block-editor', '__experimentalGetLastBlockAttributesChange' );
const lastBlockAttributesChange = yield select( 'core/block-editor', '__experimentalGetLastBlockAttributeChanges' );

// Sync to sources from block attributes updates.
if ( lastBlockAttributesChange ) {
Expand Down

0 comments on commit 37a7ba9

Please sign in to comment.