Return promise value from observable subsciption
问题 Is there any chance to return from helpMe function value from getDataFromApi() ? So far every time i call this function i get "null" value. async function helpMe() { let promise = null; let sub = someService.someObservable.subscribe(async () => { promise = await getDataFromApi() }) subscriptions.push(sub) return promise; } The first goal is i need to store subscription in global sub array. The second goal is when i get response with status 400 - I dont want to open modal. Only when i get 200