-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
Look at the custom function I suggested in order to get Typer to repeat typing words from an array. While the .forEach portion seems fine, having to first call .line and then .continue seemed a bit verbose. What if we wanted to repeat certain portions of Typer, then repeat others?
In order to simplify things and have a more intuitive API I'm thinking about introducing a repeatStart method that would be used something like this:
typer('.some-class')
.cursor({block: true})
.line()
// Portion 1 to repeat 3 times
.repeatStart()
.continue('Hip-Hop')
.pause(2000)
.back('all')
.continue('Truth')
.pause(2000)
.back('all')
.continue('Free Speech')
.pause(2000)
.back('all')
.repeat(3)
.line()
// Portion 2 to repeat 3 times...
.repeatStart()
/* ...methods here... */
.repeat(3)I'm pretty sure that currently it's possible to use repeat in place of repeatStart in the example above and it would work. But that's confusing. Even if repeatStart was a wrapper around repeat, that would improve the API.
Metadata
Metadata
Assignees
Labels
No labels