-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: eslint more strict and some minor refactors
- Loading branch information
1 parent
4825739
commit d2c2a56
Showing
10 changed files
with
36 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export * from './axios'; | ||
export * as Constants from './constants'; | ||
export * from './storage'; | ||
export * as StatusCodes from './util/status-codes'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
import { CacheRequestConfig } from '../axios/types'; | ||
|
||
export function defaultKeyGenerator({ | ||
export type KeyGenerator = (options: CacheRequestConfig) => string; | ||
|
||
export const defaultKeyGenerator: KeyGenerator = ({ | ||
baseURL, | ||
url, | ||
method, | ||
method: nullableMethod, | ||
params, | ||
id | ||
}: CacheRequestConfig): string { | ||
return id | ||
? `id::${String(id)}` | ||
: `${method?.toLowerCase() || 'get'}::${baseURL}::${url}::${JSON.stringify(params || '{}')}`; | ||
} | ||
}) => { | ||
if (id) { | ||
return `id::${String(id)}`; | ||
} | ||
|
||
const method = nullableMethod?.toLowerCase() || 'get'; | ||
const jsonParams = params ? JSON.stringify(params) : '{}'; | ||
|
||
return `${method}::${baseURL}::${url}::${jsonParams}`; | ||
}; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters