Hooks

You can do anything during the animation's lifecycle with hooks. TypingFlow supports the following hooks:

  • onStart

  • onFinish

possible-hooks-example.ts
new TypingFlow({
  renderer: simpleBrowserRenderer({ selector: ".example" }),
})
  .on("start", () => {
    console.log("Animation started");
  })
  .on("finish", () => {
    console.log("Animation finished");
  });

Also you can apply many callbacks to the same hook like this:

new TypingFlow({
   renderer: simpleBrowserRenderer({ selector: ".example" }),
})
  .on("start", () => {
    console.log("Animation started");
  })
  .on("start", () => {
    console.log("Alright");
  });

Last updated