Skip to content

Commit

Permalink
Move state.editor.blocks to state.blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Feb 19, 2019
1 parent 2b42f68 commit 4846f03
Show file tree
Hide file tree
Showing 5 changed files with 1,065 additions and 1,383 deletions.
6 changes: 3 additions & 3 deletions packages/block-editor/src/components/provider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const withRegistry = createHigherOrderComponent(
*
* @return {boolean} Whether the two objects have the same keys.
*/
function hasSameKeys( a, b ) {
export function hasSameKeys( a, b ) {
return isShallowEqual( Object.keys( a ), Object.keys( b ) );
}

Expand All @@ -52,7 +52,7 @@ function hasSameKeys( a, b ) {
*
* @return {boolean} Whether actions are updating the same block attribute.
*/
function isUpdatingSameBlockAttribute( action, lastAction ) {
export function isUpdatingSameBlockAttribute( action, lastAction ) {
return (
action.type === 'UPDATE_BLOCK_ATTRIBUTES' &&
action.clientId === lastAction.clientId &&
Expand Down Expand Up @@ -86,7 +86,7 @@ function createChangeObserver( store, callback ) {
isPendingCommit = false;
} else if ( lastAction && lastState && state !== lastState ) {
if (
state.editor.blocks !== lastState.editor.blocks &&
state.blocks !== lastState.blocks &&
isUpdatingSameBlockAttribute( action, lastAction )
) {
// So long as block updates occur as operating on the same
Expand Down
Loading

0 comments on commit 4846f03

Please sign in to comment.