# chain

Plugin for creating linked animations. That is, when one ends, the next one begins.

{% hint style="warning" %}
Be careful with looping animations when using **chain**
{% endhint %}

### Usage

```typescript
import { TypingFlow } from "typing-flow";
import { chain } from "typing-flow/plugins";

const flow1 = new TypingFlow({...}).commands([...]);
const flow2 = new TypingFlow({...}).commands([...]);
const flow3 = new TypingFlow({...}).commands([...]);

// chainedFlow === flow1
const chainedFlow = chain(flow1, flow2, flow3);

chainedFlow.start();
```

**chain** returns the <mark style="color:orange;">first flow</mark> passed. This must be remembered when using.
