Socket
Socket
Sign inDemoInstall

@wordpress/dom-ready

Package Overview
Dependencies
Maintainers
4
Versions
155
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wordpress/dom-ready - npm Package Compare versions

Comparing version 0.1.0-beta.1 to 0.1.0-beta.2

4

package.json
{
"name": "@wordpress/dom-ready",
"version": "0.1.0-beta.1",
"version": "0.1.0-beta.2",
"description": "Execute callback after the DOM is loaded.",
"homepage": "https://github.com/WordPress/packages/tree/master/packages/domReady/README.md",
"homepage": "https://github.com/WordPress/packages/tree/master/packages/dom-ready/README.md",
"author": "WordPress",

@@ -7,0 +7,0 @@ "keywords": [

@@ -1,2 +0,2 @@

# @wordpress/domReady
# @wordpress/dom-ready

@@ -10,3 +10,3 @@ Executes a function after the DOM has loaded.

```bash
npm install @wordpress/domReady --save
npm install @wordpress/dom-ready --save
```

@@ -17,3 +17,3 @@

```JS
import domReady from '@wordpress/domReady';
import domReady from '@wordpress/dom-ready';

@@ -20,0 +20,0 @@ domReady( function() {

@@ -6,26 +6,26 @@ import domReady from '../';

it( 'should call the callback.', () => {
let callback = jest.fn(() => {});
let callback = jest.fn( () => {} );
domReady( callback );
expect( callback ).toHaveBeenCalled();
});
});
} );
} );
describe( 'when document readystate is still loading', () => {
it( 'should add the callback as an event listener to the DOMContentLoaded event.', () => {
let addEventListener = jest.fn(() => {});
let addEventListener = jest.fn( () => {} );
Object.defineProperty( document, 'readyState', {
value: 'loading',
});
} );
Object.defineProperty( document, 'addEventListener', {
value: addEventListener,
});
} );
let callback = jest.fn(() => {});
let callback = jest.fn( () => {} );
domReady( callback );
expect( callback ).not.toHaveBeenCalled();
expect( addEventListener ).toHaveBeenCalledWith( 'DOMContentLoaded', callback );
});
});
});
} );
} );
} );
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc