Typing Flow Docs
  • Introduction
    • Get started
    • Configuration
    • Commands
      • text
      • backspace
      • del
      • cursorLeft
      • cursorRight
      • delay
      • home
      • end
    • Examples
  • Features
    • Renderers
    • Hooks
  • Plugins
    • chain
Powered by GitBook
On this page
  1. Features

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");
  });

PreviousRenderersNextchain

Last updated 3 months ago