UNPKG

yarn-spinner-runner-ts

Version:

TypeScript parser, compiler, and runtime for Yarn Spinner 3.x with React adapter [NPM package](https://www.npmjs.com/package/yarn-spinner-runner-ts)

26 lines (20 loc) 619 B
## Flow Control (Yarn Spinner) Source: [docs.yarnspinner.dev Flow Control](https://docs.yarnspinner.dev/write-yarn-scripts/scripting-fundamentals/flow-control) ### What it covers - Conditional blocks with `{if}`, `{else if}`, `{else}`, `{endif}`. - Loops and structural control features provided by Yarn (engine-dependent usage). - Combining flow with variables and options. ### Example ```yarn title: Start --- <<set affinity = 3>> {if affinity >= 5} NPC: We're close friends. {else if affinity >= 2} NPC: We're friendly enough. {else} NPC: Do I know you? {endif} === ```