@wordpress/api-fetch
Advanced tools
Comparing version 1.0.2 to 1.1.0
@@ -6,3 +6,3 @@ import _objectSpread from "@babel/runtime/helpers/objectSpread"; | ||
*/ | ||
import jQuery from 'jquery'; | ||
import { addAction } from '@wordpress/hooks'; | ||
@@ -19,3 +19,3 @@ var createNonceMiddleware = function createNonceMiddleware(nonce) { | ||
jQuery(document).on('heartbeat-tick', function (event, response) { | ||
addAction('heartbeat.tick', 'core/api-fetch/create-nonce-middleware', function (response) { | ||
if (response['rest-nonce']) { | ||
@@ -22,0 +22,0 @@ usedNonce = response['rest-nonce']; |
@@ -12,3 +12,3 @@ "use strict"; | ||
var _jquery = _interopRequireDefault(require("jquery")); | ||
var _hooks = require("@wordpress/hooks"); | ||
@@ -28,3 +28,3 @@ /** | ||
(0, _jquery.default)(document).on('heartbeat-tick', function (event, response) { | ||
(0, _hooks.addAction)('heartbeat.tick', 'core/api-fetch/create-nonce-middleware', function (response) { | ||
if (response['rest-nonce']) { | ||
@@ -31,0 +31,0 @@ usedNonce = response['rest-nonce']; |
{ | ||
"name": "@wordpress/api-fetch", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"description": "Utility to make WordPress REST API requests.", | ||
@@ -24,4 +24,4 @@ "author": "The WordPress Contributors", | ||
"@babel/runtime": "^7.0.0-beta.52", | ||
"@wordpress/i18n": "^1.2.2", | ||
"jquery": "^3.3.1" | ||
"@wordpress/hooks": "^1.3.2", | ||
"@wordpress/i18n": "^1.2.2" | ||
}, | ||
@@ -31,3 +31,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "04961befa151ae1224f50ae2b3742d797b7409d9" | ||
"gitHead": "a942c459289bf89841a00a71272d09068f830ce5" | ||
} |
/** | ||
* External dependencies | ||
*/ | ||
import jQuery from 'jquery'; | ||
import { addAction } from '@wordpress/hooks'; | ||
@@ -14,3 +14,3 @@ const createNonceMiddleware = ( nonce ) => ( options, next ) => { | ||
*/ | ||
jQuery( document ).on( 'heartbeat-tick', ( event, response ) => { | ||
addAction( 'heartbeat.tick', 'core/api-fetch/create-nonce-middleware', ( response ) => { | ||
if ( response[ 'rest-nonce' ] ) { | ||
@@ -17,0 +17,0 @@ usedNonce = response[ 'rest-nonce' ]; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33649
+ Added@wordpress/hooks@^1.3.2
+ Added@wordpress/hooks@1.3.3(transitive)
- Removedjquery@^3.3.1
- Removedjquery@3.7.1(transitive)