Replies: 1 comment
-
This is how javascript works actually. As you are calling remove as a standalone function, but this function was part of a class before, you lost the correct "this" pointer. TLDR; do not destructure class methods it will never work. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have this code where onComplete or onError I remove the job. If I destructure
remove
from the job and call it, it would fail with a typeerror (see below), where as if I don't destructure it works as expected.Appreciate if someone could help explain why this happens.
Error:
TypeError: Cannot read properties of undefined (reading 'queue')
Beta Was this translation helpful? Give feedback.
All reactions