please help me with this problem
https://stackoverflow.com/questions/58768962/how-to-fix-the-problem-of-type-compatibility-in-typescript-when-trying-to-consum
For further actions, you may consider blocking this person and/or reporting abuse
please help me with this problem
https://stackoverflow.com/questions/58768962/how-to-fix-the-problem-of-type-compatibility-in-typescript-when-trying-to-consum
For further actions, you may consider blocking this person and/or reporting abuse
Achref Ben El Hadj Salem -
Hitesh Chauhan -
Hitesh Chauhan -
Nick Vahalik -
Top comments (3)
I added an thorough answer on SO, I'll add the TLDR version here:
This code wont work as expected
it should be this:
If the
getOwners()
call takes say 5 seconds to return, JS wont wait, and will keep executing code after it, only calling thesubscribe
callback once the data comes back. As I mentioned in the reply I recommend reading about how JS handles async stuff, as its key to the language.In future, please don't just paste a link to Stack Overflow or the #help tag will be removed.
At least provide a short summary of what your issue is.
Thanks.
ah ok am sorry new here i will make sure to do that in the future ^