From 57cf8f2a879a2158be12ea7be5df43ab75f71853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Wed, 17 Jun 2020 16:59:36 +0200 Subject: [PATCH] Remove general resolveSelect control --- .../edit-navigation/src/store/controls.js | 32 ++++--------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/packages/edit-navigation/src/store/controls.js b/packages/edit-navigation/src/store/controls.js index ff5e140559b113..6d042a26fb1a42 100644 --- a/packages/edit-navigation/src/store/controls.js +++ b/packages/edit-navigation/src/store/controls.js @@ -54,10 +54,8 @@ export function getNavigationPost( menuId ) { export function resolveMenuItems( menuId ) { return { - type: 'RESOLVE_SELECT', - registryName: 'core', - selectorName: 'getMenuItems', - args: [ menuItemsQuery( menuId ) ], + type: 'RESOLVE_MENU_ITEMS', + query: menuItemsQuery( menuId ), }; } @@ -78,24 +76,6 @@ export function select( registryName, selectorName, ...args ) { }; } -/** - * Dispatches a control action for triggering a registry select that has a - * resolver. - * - * @param {string} registryName - * @param {string} selectorName - * @param {Array} args Arguments for the select. - * @return {Object} control descriptor. - */ -export function resolveSelect( registryName, selectorName, ...args ) { - return { - type: 'RESOLVE_SELECT', - registryName, - selectorName, - args, - }; -} - export function dispatch( registryName, actionName, ...args ) { return { type: 'DISPATCH', @@ -143,11 +123,11 @@ const controls = { } ), - RESOLVE_SELECT: createRegistryControl( - ( registry ) => ( { registryName, selectorName, args } ) => { + RESOLVE_MENU_ITEMS: createRegistryControl( + ( registry ) => ( { query } ) => { return registry - .__experimentalResolveSelect( registryName ) - [ selectorName ]( ...args ); + .__experimentalResolveSelect( 'core' ) + .getMenuItems( query ); } ), };