Answer the question
In order to leave comments, you need to log in
How to return return from a class in JS?
Hello, the essence of the question is that I have several classes, each of which is sharpened for certain operations and the final class must return certain values. Extend does not pass, because classes are called in a random way, or rather their functions. So here's the question. how to return to it the value of the third function of another when calling a function from one class. A little more detailed: Class A ----> Class B---> function one ---> function two => return for class One (some Data). The problem is due to promises, so I would have done everything myself, or rather axios, in Class One you can’t call it in any way, otherwise it will turn out to be 1000 lines. Do not judge, all the time I worked in python in asynchrony, everything is easier there, and now the order is such a thank you.
Answer the question
In order to leave comments, you need to log in
1. Axios can be called with await.
2. If typescript, then you can mark the method as static.
3. If I understand correctly, maybe you should look into currying.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question