Skip to content

Category: Questions

Using async functions as conditions

Lets say i want to run an if statment where the condition is async function. This is the function, it uses mongoose findOne which is an async task. The problem is that the if statment gets called before the con can get executed which then does’nt set the condition. Answer You can do it this way : Return…

React Native UseEffect API CALLS

How to handle multiple api calls in the same render ? Example : I want to get some info from first API call like this for example : and i want to instantly use it for the next API CALL coming under this call example : Soo the question is how to use information that i get inside first API

Keep dynamic variables between tests in Cypress

I am trying to do a Cypress test where I want to set in an input a random number and after that check that random number is set ok in another page. I’m creating the random number with this function: And setting the variables inside the describe like: The issue I’m currently having is that the vari…

Streaming into element

I would like to play audio from a web socket that sends packages of sound data of unknown total length. The playback should start as soon as the first package arrives and it should not be interrupted by new packages. What I have done so far: However, to my knowledge, it is not possible to extend the size of A…

Cant start angular project

I was having some problems with an angular project so i reinstalled nodejs and angular cli however now when i try to run ng serve i get this error: enter image description here now ive done the typical google searching for this problem and it led me to stackoverflow with making sure the nodejs is in the envir…