Skip to content

Commit

Permalink
feat: reimplement getIsRefreshing and setIsRefreshing functions
Browse files Browse the repository at this point in the history
  • Loading branch information
mvanroon committed Mar 21, 2022
1 parent 6f279e3 commit 6ab70d3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,24 @@ type RequestsQueue = {
let isRefreshing = false
let queue: RequestsQueue = []

/**
* Check if tokens are currently being refreshed
*
* @returns {boolean} True if the tokens are currently being refreshed, false is not
*/
export function getIsRefreshing(): boolean {
return isRefreshing
}

/**
* Update refresh state
*
* @param {boolean} newRefreshingState
*/
export function setIsRefreshing(newRefreshingState: boolean): void {
isRefreshing = newRefreshingState
}

/**
* Function that resolves all items in the queue with the provided token
* @param token New access token
Expand Down

0 comments on commit 6ab70d3

Please sign in to comment.