@beyonk/svelte-facebook-pixel
Advanced tools
Comparing version 2.0.1 to 2.1.0
35
index.js
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('svelte/internal'), require('svelte')) : | ||
typeof define === 'function' && define.amd ? define(['svelte/internal', 'svelte'], factory) : | ||
(global = global || self, global.FacebookPixel = factory(global.internal, global.svelte)); | ||
}(this, function (internal, svelte) { 'use strict'; | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('svelte/internal')) : | ||
typeof define === 'function' && define.amd ? define(['svelte/internal'], factory) : | ||
(global = global || self, global.FacebookPixel = factory(global.internal)); | ||
}(this, function (internal) { 'use strict'; | ||
/* src/FacebookPixel.svelte generated by Svelte v3.5.4 */ | ||
/* src/FacebookPixel.svelte generated by Svelte v3.6.4 */ | ||
@@ -25,6 +25,17 @@ function create_fragment(ctx) { | ||
svelte.onMount(() => { | ||
function enable () { | ||
mount(); | ||
init(); | ||
track(); | ||
} | ||
function mount () { | ||
if (window['fbq']) { | ||
_fbq = window['fbq']; | ||
return | ||
} | ||
if (!id) { | ||
throw new Error( | ||
`id configuration parameter is required, try <FacebookPixel id="12345" /> or <FacebookPixel id="['12345', '67890']" /> for multiple pixels` | ||
`id configuration parameter is required, try <FacebookPixel id="12345" /> or <FacebookPixel id={['12345', '67890']} /> for multiple pixels` | ||
) | ||
@@ -35,7 +46,2 @@ } | ||
if (window['fbq']) { | ||
_fbq = window['fbq']; | ||
return | ||
} | ||
/* eslint-disable */ | ||
@@ -65,7 +71,2 @@ const scr = (f, b, e, v, n, t, s) => { | ||
} | ||
}); | ||
function enable () { | ||
init(); | ||
track(); | ||
} | ||
@@ -72,0 +73,0 @@ |
{ | ||
"name": "@beyonk/svelte-facebook-pixel", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"svelte": "src/FacebookPixel.svelte", | ||
@@ -5,0 +5,0 @@ "module": "index.mjs", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
211
0
11875