From 00519d9e2541b6f2d8c90553de976b0e8e66d81d Mon Sep 17 00:00:00 2001 From: Philipp Stracker Date: Fri, 17 Jan 2025 16:34:17 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20Clean=20up=20Styling=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/js/data/styling/hooks.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/modules/ppcp-settings/resources/js/data/styling/hooks.js b/modules/ppcp-settings/resources/js/data/styling/hooks.js index 79314e18b..e50896ea3 100644 --- a/modules/ppcp-settings/resources/js/data/styling/hooks.js +++ b/modules/ppcp-settings/resources/js/data/styling/hooks.js @@ -7,8 +7,7 @@ * @file */ -import { __, sprintf } from '@wordpress/i18n'; -import { useCallback } from '@wordpress/element'; // Temporary +import { useCallback } from '@wordpress/element'; import { useDispatch, useSelect } from '@wordpress/data'; import { createHooksForStore } from '../utils'; @@ -26,8 +25,6 @@ const useHooks = () => { const { useTransient } = createHooksForStore( STORE_NAME ); const { persist, setPersistent } = useDispatch( STORE_NAME ); - // Read-only flags and derived state. - // Transient accessors. const [ isReady ] = useTransient( 'isReady' ); const [ location, setLocation ] = useTransient( 'location' ); @@ -39,13 +36,13 @@ const useHooks = () => { ); const getLocationProp = useCallback( - ( locatonId, prop ) => { - if ( undefined === persistentData[ locatonId ]?.[ prop ] ) { + ( locationId, prop ) => { + if ( undefined === persistentData[ locationId ]?.[ prop ] ) { console.error( - `Trying to access non-existent style property: ${ locatonId }.${ prop }. Possibly wrong style name - review the reducer.` + `Trying to access non-existent style property: ${ locationId }.${ prop }. Possibly wrong style name - review the reducer.` ); } - return persistentData[ locatonId ]?.[ prop ]; + return persistentData[ locationId ]?.[ prop ]; }, [ persistentData ] );