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

@automattic/explat-client-react-helpers

Package Overview
Dependencies
Maintainers
0
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@automattic/explat-client-react-helpers - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

4

CHANGELOG.md
# Changelog
## 0.1.1
- Remove console.log and bump dependency version
## 0.1.0

@@ -4,0 +8,0 @@

9

dist/cjs/index.js

@@ -10,3 +10,2 @@ "use strict";

const useExperiment = (experimentName, providedOptions = {}) => {
console.log('useExperiment start');
const options = {

@@ -21,10 +20,6 @@ ...defaultExperimentOptions,

(0, react_1.useEffect)(() => {
console.log('useExperiment useEffect');
let isSubscribed = true;
if (options.isEligible) {
console.log('useExperiment useEffect loadExperimentAssignment', experimentName);
exPlatClient.loadExperimentAssignment(experimentName).then((v) => {
console.log('useExperiment loadExperimentAssignment promise resolution', v);
exPlatClient.loadExperimentAssignment(experimentName).then(() => {
if (isSubscribed) {
console.log('useExperiment loadExperimentAssignment promise resolution forceUpdate()');
forceUpdate();

@@ -44,3 +39,2 @@ }

}
console.log('useExperiment end', options.isEligible);
if (!options.isEligible) {

@@ -50,3 +44,2 @@ return [false, null];

const maybeExperimentAssignment = exPlatClient.dangerouslyGetMaybeLoadedExperimentAssignment(experimentName);
console.log('useExperiment end', [!maybeExperimentAssignment, maybeExperimentAssignment]);
return [!maybeExperimentAssignment, maybeExperimentAssignment];

@@ -53,0 +46,0 @@ };

@@ -8,3 +8,2 @@ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";

const useExperiment = (experimentName, providedOptions = {}) => {
console.log('useExperiment start');
const options = {

@@ -19,10 +18,6 @@ ...defaultExperimentOptions,

useEffect(() => {
console.log('useExperiment useEffect');
let isSubscribed = true;
if (options.isEligible) {
console.log('useExperiment useEffect loadExperimentAssignment', experimentName);
exPlatClient.loadExperimentAssignment(experimentName).then((v) => {
console.log('useExperiment loadExperimentAssignment promise resolution', v);
exPlatClient.loadExperimentAssignment(experimentName).then(() => {
if (isSubscribed) {
console.log('useExperiment loadExperimentAssignment promise resolution forceUpdate()');
forceUpdate();

@@ -42,3 +37,2 @@ }

}
console.log('useExperiment end', options.isEligible);
if (!options.isEligible) {

@@ -48,3 +42,2 @@ return [false, null];

const maybeExperimentAssignment = exPlatClient.dangerouslyGetMaybeLoadedExperimentAssignment(experimentName);
console.log('useExperiment end', [!maybeExperimentAssignment, maybeExperimentAssignment]);
return [!maybeExperimentAssignment, maybeExperimentAssignment];

@@ -51,0 +44,0 @@ };

{
"name": "@automattic/explat-client-react-helpers",
"version": "0.1.0",
"version": "0.1.1",
"description": "Standalone ExPlat Client: React Helpers.",

@@ -35,3 +35,3 @@ "bugs": "https://github.com/Automattic/wp-calypso/issues",

"@automattic/calypso-typescript-config": "^1.0.0",
"@testing-library/react": "^14.2.1",
"@testing-library/react": "^15.0.7",
"jest": "^29.7.0",

@@ -38,0 +38,0 @@ "react-dom": "^18.2.0",

@@ -29,4 +29,2 @@ # ExPlat Client: React Helpers

Note: Every component that calls `useExperiment` will return loading as true for at least one render, even if the experiment is already loaded. See pbmo2S-2sV-p2 for more details.
### Type signature

@@ -33,0 +31,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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