I'd like to create and return an already resolved (fake if you prefer) Promise in angular2. In angularjs you would do something like : return $q.defer().promise
I was thinking about doing : return new Observable<any>.toPromise()
However I am not sure if that's the right way to do it.
Promise.resolve('someValue');
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise/resolve
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With