This file contains hidden or 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
/** | |
createArraySubsets generate array subsets. | |
@param {Array} array - source array. | |
@param {number} subsets - number of subsets. default is 2 | |
@returns array with number of given subsets. | |
@example | |
createArraySubsets([1,2,3,4,5,6,7,8], 2); // output: [[1,2],[3,4],[5,6],[7,8]] | |
createArraySubsets([1,2,3,4], 3); // output: [[1,2,3], [4]] | |
createArraySubsets([1,2,3,4,5,6,7,8], 4); // output: [[1,2,3,4], [5,6,7,8]] | |
*/ |
This file contains hidden or 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
import axios, { AxiosInstance, ResponseType, Method, AxiosResponse, AxiosRequestConfig } from 'axios'; | |
import { storeData, getData } from '../helpers'; | |
export const STORAGE_TOKEN_KEY_NAME = 'token'; | |
const PROTOCOL = 'https://'; // protocols: 'http', 'https' | |
const BASE_URL = 'example.com/'; // include just domain or sub domain and domain name. | |
const LEVEL_ONE_ENDPOINT = 'api/v1/'; // first level uri. include versioning etc. | |
const TOKEN_PRIFIX = 'token '; // do not remove the space. samples: token, Bearer, etc. |
OlderNewer