OpenWaterFoundation / owf-app-dev-ng

Open Water Foundation Angular application to develop common libraries
0 stars 1 forks source link

Replace toPromise RXJS function with firstValueFrom #25

Closed Nightsphere closed 2 years ago

Nightsphere commented 2 years ago

The angulardev application in the AppDev project workspace uses the very convenient APP_INITIALIZER dependency injection token to read in the necessary files needed to start the application before anything else happens, so the application won't have to wait for the file contents to be retrieved. This eliminates any asynchronous errors at app creation, and should be used in the Infomapper in the future as well.

This token uses a function that called the .toPromise() function to convert an observable to a promise. This has been deprecated in RXJS version 7 and will not exist in version 8.

Nightsphere commented 2 years ago

Removed the old function and replaced with the new. Tested and the angulardev app in the workspace still works as expected. Closing this issue.