Memory leak of accessChecker.isGranted ??
- Dominant language
- TypeScript
- Stars
- 8.1k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
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..

Contributor guide
Assessment
This issue has not been assessed yet.