PHP Classes

File: src/data/jobs/controls.ts

Recommend this page to a friend!
  Classes of Maniruzzaman Akash   WordPress React Plugin Kit   src/data/jobs/controls.ts   Download  
File: src/data/jobs/controls.ts
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: WordPress React Plugin Kit
Environment to develop new WordPress plugins
Author: By
Last change:
Date: 1 year ago
Size: 544 bytes


Class file image Download
/** * External dependencies. */ import apiFetch from '@wordpress/api-fetch'; const controls = { FETCH_FROM_API(action) { return apiFetch({ path: action.path }); }, FETCH_FROM_API_UNPARSED(action) { return apiFetch({ path: action.path, parse: false }).then( (response: { headers: object; json: any }) => Promise.all([response.headers, response.json()]).then( ([headers, data]) => ({ headers, data }) ) ); }, }; export default controls;