fetch-json
fetch-json copied to clipboard
Add option to enable/disable logging per call
It would be convenient to turn on or off logging (especially for debugging) with something like:
fetchJson.enableLogger();
fetchJson.get(url).then(handleData); //call is logged
fetchJson.get(url, { log: false }).then(handleData); //call is NOT logged
See the two instances of if (fetchJson.logger)
in fetch-json.ts.