Memory leak of accessChecker.isGranted ??
- Langage dominant
- TypeScript
- Étoiles
- 8.1k
- Forks
- 1.5k
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
Version 9
I'm using this to display a button depending on user roles :
```
```
It is calling this method :
```
@Injectable()
export class NbSimpleRoleProvider extends NbRoleProvider {
getRole(): Observable {
return this.authService.onTokenChange()
.pipe(
map((token: NbAuthJWTToken) => {
console.log('Ton role est : ' + token.getPayload().roles[0].authority); // Calling so much time this !
return token.isValid() ? token.getPayload().roles[0].authority : 'GUEST';
}),
);
}
..
..
..
}
```
The problem is that the page is calling so many times "accessChecker.isGranted" ! For each row of my table it calls the accessChecker, and if i keep the mouse on the button without doing anything else, it keep calling "accessChecker.isGranted" !
So thousand of calls in few seconds..

Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.