Brand new, empty “Styling” store in Redux

This commit is contained in:
Philipp Stracker 2025-01-13 17:06:05 +01:00
parent 5b192f3cc7
commit 63f417d7d2
No known key found for this signature in database
14 changed files with 471 additions and 7 deletions

View file

@ -0,0 +1,23 @@
/**
* Controls: Implement side effects, typically asynchronous operations.
*
* Controls use ACTION_TYPES keys as identifiers.
* They are triggered by corresponding actions and handle external interactions.
*
* @file
*/
import apiFetch from '@wordpress/api-fetch';
import { REST_PERSIST_PATH } from './constants';
import ACTION_TYPES from './action-types';
export const controls = {
async [ ACTION_TYPES.DO_PERSIST_DATA ]( { data } ) {
return await apiFetch( {
path: REST_PERSIST_PATH,
method: 'POST',
data,
} );
},
};