If registerListeners is a promise it won't wait for that to be done as the .then doesn't return anything. It'll return immediately after it calls registerListeners as the .then function returns undefined.
If registerListeners isn't a promise then it's just mixing a couple of different flow controls unnecessarily. Instead you could do something like
Huh, I looked at the code multiple times and still completely missed that. I agree that it's unnecessary to mix callbacks and await here, though I don't think it's particularly bad, either.
8
u/MurdoMaclachlan public boolean isInt(int i) { return true; } Nov 02 '21
Image Transcription: Code
I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!
8
u/CommenceTheConfusion Nov 02 '21
What's the problem here? This looks fine to me.