jeremyckahn / shifty

The fastest TypeScript animation engine on the web
https://jeremyckahn.github.io/shifty/doc/
MIT License
1.54k stars 88 forks source link

this._reject is not a function #108

Closed kurtextrem closed 5 years ago

kurtextrem commented 5 years ago

While trying out your solution: https://github.com/jeremyckahn/shifty/issues/107#issuecomment-444178869

I've encountered the following error: Uncaught TypeError: this._reject is not a function shifty:2 at t.value (shifty.js:2)

it happens when calling .stop(false) on an existing tweening instance (created with new Tweenable)

(same happens when I call .stop(true), but with the error this._resolve is not a function)

kurtextrem commented 5 years ago

So this happens when setConfig hasn't been called yet. Not sure if still an issue then. Feel free to close if you don't think it is.

jeremyckahn commented 5 years ago

Hi @kurtextrem, I'd be curious to know what code is causing this error to occur. I can only see this happening if a new tween was started with no parameters and then.stop() was called. Assuming that's what's causing this, what is the use case for starting a tween without parameters?

kurtextrem commented 5 years ago

No use case, it simply happened - so as I said feel free to close (in case you don't want to add a warning or so)

jeremyckahn commented 5 years ago

Understood. It sounds like the API was not being used as intended, so I would prefer to make no change at this time. I am open to PRs to change the error handling, though!

I will close this for now. Thanks for reporting this issue, though!