Skip to content

Instantly share code, notes, and snippets.

@ivarconr
Created January 24, 2019 10:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivarconr/2eed93adf92eff4a2e5270384e6847da to your computer and use it in GitHub Desktop.
Save ivarconr/2eed93adf92eff4a2e5270384e6847da to your computer and use it in GitHub Desktop.
var unleashContext = {};
var fallbackVariant = {
enabled: false,
name: "disabled",
}
const varinat = getVariant('toggleName', unleashContext, fallbackVariant);
switch(variant.name) {
case "variant1"
varinat.payload.height
varinat.payload.color
case "variant2"
varinat.payload.height
varinat.payload.color
default:
//old stuff:
}
const varinat = getVariant('toggleName', unleashContext, fallbackVariant);
img.color = variant.payload.color;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment