typeit icon indicating copy to clipboard operation
typeit copied to clipboard

Lack of cleanup function

Open mwskwong opened this issue 1 year ago • 2 comments

Currenet behavior

There isn't a function that terminates the animation, destroys the TypeItInstance, and resets everything.

The closest things are reset() and destroy(), but none of the two are doing actual cleanup work once and for all.

Expected behavior

A new API, or even replacing destroy() should be introduced for doing proper cleanup work.

mwskwong avatar Jul 31 '22 04:07 mwskwong

It seems that there isn't much progress to it. It could be a problem when the component is re-rendered

mwskwong avatar Jan 24 '23 13:01 mwskwong

It seems that there isn't much progress to it. It could be a problem when the component is re-rendered

Same as you, I was having an issue where destroy() wouldn't actually kill the animation in time and would continue to run in the background. It was a super inconsistent bug to reproduce. I was able to use a combo of

typeit.freeze()
typeit.destroy()

to kill the animation entirely. Hope it help anyone how comes here for a similar bug.

Would be nice to have a function .kill() or .terminate or whatever that accomplishes whatever this workaround does.

jacoblockett avatar Jun 28 '23 15:06 jacoblockett