Skip to content

Allow Queues to Be Rebuilt After reset()

Compare
Choose a tag to compare
@alexmacarthur alexmacarthur released this 14 Feb 04:46
· 66 commits to master since this release

As an instance is being reset using .reset(), you can now completely rebuild the queue, replacing it with a totally new set of commands. For example:

const instance = new TypeIt("#element", {
   speed: 75
})
   .type("This is my initial text!")
   .go();

instance.reset(i => {
   i
      .type("But this will be typed the second time... ")
      .break()
      .type("completely replacing the original queue.");
});

instance.go();