Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

editor: remove two unused registry controls #26048

Merged
merged 1 commit into from
Oct 13, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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