Skip to main content

switch

Node Type ID: "studio.tokens.logic.switch"

Package

This is a core package available at Graph Engine

To install

npm install @tokens-studio/graph-engine

Description

Switch node allows you to conditionally choose a value based on a condition.

Inputs

condition

No description

default

No description

Outputs

No outputs

Example


const switchNode = new SwitchNode();
switchNode.addInput("foo", {
type: AnySchema,
});

switchNode.addInput("bar", {
type: AnySchema,
});

//Now if the condition matches the name 'foo' it will output the value of the foo input
// If no condition matches, it will output the value of the `default` input