Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jest-next-dynamic

Package Overview
Dependencies
Maintainers
29
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-next-dynamic - npm Package Compare versions

Comparing version 0.1.1 to 0.2.0

15

index.js

@@ -1,9 +0,10 @@

const mockPromises = [];
const mockInitializers = [];
module.exports = function preloadAll() {
if (mockPromises.length) {
const promises = mockPromises.slice();
mockPromises.length = 0;
// While loading the components in `mockPromises`, more components may have
// been dynamically loaded, adding more promises we should wait for.
if (mockInitializers.length) {
const promises = mockInitializers.map(preload => preload());
mockInitializers.length = 0;
// While loading the components in this round of initializers, more
// components may have been dynamically loaded, adding more promises we
// should wait for.
return Promise.all(promises).then(preloadAll);

@@ -20,3 +21,3 @@ } else {

const LoadableComponent = dynamic(...args);
mockPromises.push(LoadableComponent.preload());
mockInitializers.push(() => LoadableComponent.preload());
return LoadableComponent;

@@ -23,0 +24,0 @@ };

{
"name": "jest-next-dynamic",
"version": "0.1.1",
"version": "0.2.0",
"main": "index.js",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -30,3 +30,3 @@ # jest-next-dynamic

{
"plugins": ["babel-plugin-dynamic-import-node]"]
"plugins": ["babel-plugin-dynamic-import-node"]
}

@@ -33,0 +33,0 @@ ```

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