@solid-primitives/script-loader
Advanced tools
Comparing version 2.0.2 to 2.1.0
@@ -6,2 +6,4 @@ import { ComponentProps, Accessor } from 'solid-js'; | ||
src: string | Accessor<string>; | ||
/** arbitrary data attributes commonly used by tracking scripts */ | ||
[dataAttribute: `data-${string}`]: any; | ||
}; | ||
@@ -20,3 +22,3 @@ /** | ||
* src: "https://example.com/script.js", | ||
* async onLoad() { | ||
* onLoad() { | ||
* // do your stuff... | ||
@@ -23,0 +25,0 @@ * } |
@@ -12,3 +12,3 @@ import { splitProps, createRenderEffect, onCleanup } from 'solid-js'; | ||
const [local, scriptProps] = splitProps(props, OMITTED_PROPS); | ||
spread(script, scriptProps, false, true); | ||
setTimeout(() => spread(script, scriptProps, false, true)); | ||
createRenderEffect(() => { | ||
@@ -15,0 +15,0 @@ const src = typeof local.src === "string" ? local.src : local.src(); |
{ | ||
"name": "@solid-primitives/script-loader", | ||
"version": "2.0.2", | ||
"version": "2.1.0", | ||
"description": "Primitive to load scripts dynamically", | ||
@@ -50,7 +50,12 @@ "author": "Alex Lohr <alex.lohr@logmein.com>", | ||
"typesVersions": {}, | ||
"devDependencies": { | ||
"solid-js": "^1.8.7" | ||
}, | ||
"scripts": { | ||
"build": "jiti ../../scripts/build.ts", | ||
"test": "vitest -c ../../configs/vitest.config.ts", | ||
"test:ssr": "pnpm run test --mode ssr" | ||
"dev": "tsx ../../scripts/dev.ts", | ||
"build": "tsx ../../scripts/build.ts", | ||
"vitest": "vitest -c ../../configs/vitest.config.ts", | ||
"test": "pnpm run vitest", | ||
"test:ssr": "pnpm run vitest --mode ssr" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
9569
8
97
1