Configure optional cursor with only one intuitively-called cursor parameter
By default, iTyped shows a cursor with the character |. You can customize the character or disable the cursor by passing cursor: "" or cursor: false.
Use document.getElementById
I think it was misleading to use document.querySelector. The user should use an id anyway. Unless they want to use iTyped in several elements at the same time, targeting them by class or tag, but, even then, it wouldn’t have worked because we weren’t using querySelectAll.
If the user is going to be bored, it’s better they know in advance what they have to tweak instead of having to find where the bug is.
there you have it. I’ll copy the same considerations from PR #6 for documentation purposes.
Some of the changes
No async forEach
Used just plain old JavaScript timers to manage asynchronous behaviour.
Use ES6 features to handle parameters
Used default values and simulated named parameters.
Configure optional cursor with only one intuitively-called
cursor
parameterBy default, iTyped shows a cursor with the character
|
. You can customize the character or disable the cursor by passingcursor: ""
orcursor: false
.Use
document.getElementById
I think it was misleading to use
document.querySelector
. The user should use an id anyway. Unless they want to use iTyped in several elements at the same time, targeting them by class or tag, but, even then, it wouldn’t have worked because we weren’t usingquerySelectAll
.If the user is going to be bored, it’s better they know in advance what they have to tweak instead of having to find where the bug is.