splitio-react
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -37,2 +37,3 @@ "use strict"; | ||
var hasSplitLoaded = !!splitio; | ||
(0, _react.useEffect)(function () { | ||
@@ -50,3 +51,3 @@ var initSplitClient = | ||
case 0: | ||
if (key) { | ||
if (!(!key || !splitio)) { | ||
_context.next = 2; | ||
@@ -59,3 +60,2 @@ break; | ||
case 2: | ||
// eslint-disable-next-line no-undef | ||
client = splitio({ | ||
@@ -90,3 +90,3 @@ core: { | ||
initSplitClient(); | ||
}, [key]); | ||
}, [key, hasSplitLoaded, authorizationKey, trafficType]); | ||
return splitClient; | ||
@@ -93,0 +93,0 @@ }; |
{ | ||
"name": "splitio-react", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "react split-io wrapper library", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/kyle-ruan/splitio-react.git", |
@@ -0,1 +1,2 @@ | ||
/* eslint-disable no-undef */ | ||
import { useState, useEffect } from 'react'; | ||
@@ -13,10 +14,10 @@ | ||
const [splitClient, setSplitClient] = useState(); | ||
const hasSplitLoaded = !!splitio; | ||
useEffect(() => { | ||
const initSplitClient = async () => { | ||
if (!key) { | ||
if (!key || !splitio) { | ||
return; | ||
} | ||
// eslint-disable-next-line no-undef | ||
const client = splitio({ | ||
@@ -40,3 +41,3 @@ core: { | ||
initSplitClient(); | ||
}, [key]); | ||
}, [key, hasSplitLoaded, authorizationKey, trafficType]); | ||
@@ -43,0 +44,0 @@ return splitClient; |
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
471597
537