donejs / donejs/bitcentive

Logout button triggers lots of recomputes

Open
#340 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7
Forks
3
PR merge metrics
No merged PRs in 30d

Description

When logout is clicked, there is a compute that cycles a lot times (happens in dev, and with optimized build).

If you have the dev-tools open you can see it hitting the `else` in the code below a bunch of times:

```js
// can-connect-feathers/session/session
getData: function() {
return new Promise(function(resolve, reject) {
var tokenLocation = options.tokenKey || options.cookie;
if (hasValidToken(tokenLocation) && !window.doneSsr) {
feathersClient
.authenticate()
.then(function(data) {
var payload = decode(data.accessToken);
return resolve(payload);
})
.catch(reject);
} else {
reject(new errors.NotAuthenticated("Not Authenticated"));
}
});
}
```

I added a console.log before the rejection and:

![screen shot 2017-10-05 at 11 36 57](https://user-images.githubusercontent.com/724877/31242036-fc424ac6-a9c2-11e7-9e1d-519eb2fbfec6.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.