403Webshell
Server IP : 104.21.14.103  /  Your IP : 18.118.166.45
Web Server : LiteSpeed
System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : giankuin ( 1871)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/giankuin/www/wp-content/plugins/woocommerce/packages/woocommerce-blocks/assets/js/data/schema/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/giankuin/www/wp-content/plugins/woocommerce/packages/woocommerce-blocks/assets/js/data/schema/resolvers.js
/**
 * External dependencies
 */
import { select, apiFetch } from '@wordpress/data-controls';

/**
 * Internal dependencies
 */
import { receiveRoutes } from './actions';
import { STORE_KEY } from './constants';

/**
 * Resolver for the getRoute selector.
 *
 * Note: All this essentially does is ensure the routes for the given namespace
 * have been resolved.
 *
 * @param {string} namespace  The namespace of the route being resolved.
 */
export function* getRoute( namespace ) {
	// we call this simply to do any resolution of all endpoints if necessary.
	// allows for jit population of routes for a given namespace.
	yield select( STORE_KEY, 'getRoutes', namespace );
}

/**
 * Resolver for the getRoutes selector.
 *
 * @param {string} namespace  The namespace of the routes being resolved.
 */
export function* getRoutes( namespace ) {
	const routeResponse = yield apiFetch( { path: namespace } );
	const routes =
		routeResponse && routeResponse.routes
			? Object.keys( routeResponse.routes )
			: [];
	yield receiveRoutes( routes, namespace );
}

Youez - 2016 - github.com/yon3zu
LinuXploit