Skip to content

Commit

Permalink
editor: remove two unused registry controls (#26048)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnajdr committed Oct 13, 2020
1 parent 172f589 commit 1b818a1
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions packages/editor/src/store/controls.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,3 @@
/**
* WordPress dependencies
*/
import { createRegistryControl } from '@wordpress/data';

/**
* Returns a control descriptor signalling to subscribe to the registry and
* resolve the control promise only when the next state change occurs.
*
* @return {Object} Control descriptor.
*/
export function awaitNextStateChange() {
return { type: 'AWAIT_NEXT_STATE_CHANGE' };
}

/**
* Returns a control descriptor signalling to resolve with the current data
* registry.
*
* @return {Object} Control descriptor.
*/
export function getRegistry() {
return { type: 'GET_REGISTRY' };
}

/**
* Function returning a sessionStorage key to set or retrieve a given post's
* automatic session backup.
Expand Down Expand Up @@ -62,15 +37,6 @@ export function localAutosaveClear( postId, isPostNew ) {
}

const controls = {
AWAIT_NEXT_STATE_CHANGE: createRegistryControl( ( registry ) => () =>
new Promise( ( resolve ) => {
const unsubscribe = registry.subscribe( () => {
unsubscribe();
resolve();
} );
} )
),
GET_REGISTRY: createRegistryControl( ( registry ) => () => registry ),
LOCAL_AUTOSAVE_SET( { postId, isPostNew, title, content, excerpt } ) {
localAutosaveSet( postId, isPostNew, title, content, excerpt );
},
Expand Down

0 comments on commit 1b818a1

Please sign in to comment.