-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore : remove Q, replace with standard Promise #309
Conversation
1eb0ee8
to
5fc3aab
Compare
5fc3aab
to
cf9d8c5
Compare
packages/okta-auth-js/lib/token.js
Outdated
var deferred = Q.defer(); | ||
var responseHandler; | ||
var timeoutId; | ||
var promise = new Promise(function(resolve, reject) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Perhaps a more descriptive name. A promise of what?
packages/okta-auth-js/lib/token.js
Outdated
var closePoller; | ||
var popupClosedPromise = new Promise(function(resolve, reject) { | ||
/* eslint-disable-next-line no-case-declarations, no-inner-declarations */ | ||
function hasClosed(win) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function name implies a boolean return w/o side effects, but it looks to actually to be all about a side-effect. Perhaps pull the reject()
out and call reject()
explicitly where hasClosed()
is called? (At which point you can define hasClosed()
externally and don't need to override eslint)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will refactor this section a bit
}); | ||
authClient.tokenManager.on('error', function() { | ||
renewDeferred.resolve(); | ||
promise = new Promise(function(resolve) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: perhaps a more descriptive var name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a test helper setup block, it handles a very diverse range of cases. It doesn't seem like there is a more specific name we can use. It is inside a block } else if (opts.autoRenew) {
so this is the autoRenew promise.
e3df546
to
0a08bf9
Compare
a55851d
to
c37adc1
Compare
Updating our "engines" and .travis file to match.