I can see in GitHub project angular-10-signup-verification-boilerplate the following snippet:
export function appInitializer(accountService: AccountService) {
return () => new Promise(resolve => {
// attempt to refresh token on app start up to auto authenticate
accountService.refreshToken()
.subscribe()
.add(resolve);
});
}
I was wondering if somebody could explain what is the meaning of add function with parameter resolve. Documentation says that add function is for adding additional subscribers so they can be unsubscribed in one go.