[ Index ]

PHP Cross Reference of WordPress




/wp-includes/js/dist/ -> api-fetch.js (summary)

(no description)

File Size: 838 lines (24 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 10 functions


Functions that are not part of a class:

__webpack_require__(moduleId)   X-Ref
No description

getDefault()   X-Ref
No description

getModuleExports()   X-Ref
No description

createNonceMiddleware(nonce)   X-Ref

param: {string} nonce
return: {import('../types').APIFetchMiddleware & { nonce: string }} A middleware to enhance a request with a nonce.

getStablePath(path)   X-Ref
Given a path, returns a normalized path where equal query parameter values
will be treated as identical, regardless of order they appear in the original

param: {string} path Original path.
return: {string} Normalized path.

createPreloadingMiddleware(preloadedData)   X-Ref

param: {Record<string, any>} preloadedData
return: {import('../types').APIFetchMiddleware} Preloading middleware.

parseAndThrowError(response, shouldParseResponse = true)   X-Ref
Parses a response, throwing an error if parsing the response fails.

param: {Response} response
param: {boolean} shouldParseResponse
return: {Promise<any>} Parsed response.

registerMiddleware(middleware)   X-Ref
Register a middleware

param: {import('./types').APIFetchMiddleware} middleware

setFetchHandler(newFetchHandler)   X-Ref
Defines a custom fetch handler for making the requests that will override
the default one using window.fetch

param: {FetchHandler} newFetchHandler The new fetch handler

apiFetch(options)   X-Ref

param: {import('./types').APIFetchOptions} options
return: {Promise<T>} A promise representing the request processed via the registered middlewares.

Generated: Tue Oct 26 01:00:02 2021 Cross-referenced by PHPXref 0.7.1