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

react-async-load-script

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-async-load-script - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

asyncscript.js

4

index.js
import React from 'react'
import asyncScript from 'async-script'
import asyncScript from './asyncscript.js'

@@ -19,3 +19,3 @@ /**

export function loadScripts (scripts) {
return scripts.reduce((cur, next) => cur.then(() => createPromise(next)), new Promise((resolve) => resolve()))
return Promise.all(scripts.map((url) => createPromise(url)))
}

@@ -22,0 +22,0 @@

@@ -69,5 +69,5 @@ 'use strict';

var _asyncScript = require('async-script');
var _asyncscript = require('./asyncscript.js');
var _asyncScript2 = _interopRequireDefault(_asyncScript);
var _asyncscript2 = _interopRequireDefault(_asyncscript);

@@ -88,3 +88,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

return new Promise(function (resolve, reject) {
(0, _asyncScript2.default)(document, url, function (err) {
(0, _asyncscript2.default)(document, url, function (err) {
return err ? reject(err) : resolve(url);

@@ -100,8 +100,4 @@ });

function loadScripts(scripts) {
return scripts.reduce(function (cur, next) {
return cur.then(function () {
return createPromise(next);
});
}, new Promise(function (resolve) {
return resolve();
return Promise.all(scripts.map(function (url) {
return createPromise(url);
}));

@@ -108,0 +104,0 @@ }

{
"name": "react-async-load-script",
"version": "1.0.4",
"version": "1.0.5",
"description": "Async script loader HOC for React",

@@ -8,3 +8,3 @@ "main": "lib/index.js",

"test": "jest",
"watch": "BABEL_ENV=production babel --watch index.js --out-dir lib",
"watch": "BABEL_ENV=production babel --watch *.js --out-dir lib",
"prettier": "prettier-standard 'index.js'",

@@ -18,3 +18,3 @@ "test:watch": "yarn test --watchAll",

"dependencies": {
"async-script": "^0.0.1"
"one-time": "^0.0.4"
},

@@ -42,4 +42,6 @@ "devDependencies": {

"setupTestFrameworkScriptFile": "<rootDir>/__tests__/setup.js",
"testPathIgnorePatterns": ["<rootDir>/__tests__/setup.js"]
"testPathIgnorePatterns": [
"<rootDir>/__tests__/setup.js"
]
}
}

Sorry, the diff of this file is not supported yet

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