git checkout master # you can avoid this line if you are in master...
git subtree split --prefix dist -b gh-pages # create a local gh-pages branch containing the splitted output folder
git push -f origin gh-pages:gh-pages # force the push of the gh-pages branch to the remote gh-pages branch at origin
git branch -D gh-pages # delete the local gh-pages because you will need it: ref
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
(function () { | |
const originalOpen = XMLHttpRequest.prototype.open | |
const originalSend = XMLHttpRequest.prototype.send | |
XMLHttpRequest.prototype.open = function (...args) { | |
console.log("request args", args) | |
this._url = args[1] // Capture URL | |
return originalOpen.apply(this, args) | |
} |
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
function findNestedObject(object, keyToFind, valToFind) { | |
let foundObj; | |
JSON.stringify(object, (_, nestedValue) => { | |
if (nestedValue && nestedValue[keyToFind] === valToFind) { | |
foundObj = nestedValue; | |
} | |
return nestedValue; | |
}); | |
return foundObj; | |
} |
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 { isObject } from "lodash"; | |
export default function filterNestedObject(object, keyToFind, valToFind) { | |
if (!isObject(object)) { | |
return []; | |
} | |
const keys = Object.keys(object); | |
return keys |
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
// for multiple requests | |
let isRefreshing = false; | |
let failedQueue = []; | |
const processQueue = (error, token = null) => { | |
failedQueue.forEach(prom => { | |
if (error) { | |
prom.reject(error); | |
} else { | |
prom.resolve(token); |