aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2018-06-05 05:05:56 +0800
committerDan Finlay <dan@danfinlay.com>2018-06-05 05:05:56 +0800
commit8fcaa2cf56936388ef8dfc528ecbd2354adb201e (patch)
tree3b3de0b1fdbd0b66f46483bdc1be0040f89c7ea1 /app/scripts/lib
parentf5d4acf53b2d518df1b2c0b9b983bbc5224fb670 (diff)
downloadtangerine-wallet-browser-8fcaa2cf56936388ef8dfc528ecbd2354adb201e.tar
tangerine-wallet-browser-8fcaa2cf56936388ef8dfc528ecbd2354adb201e.tar.gz
tangerine-wallet-browser-8fcaa2cf56936388ef8dfc528ecbd2354adb201e.tar.bz2
tangerine-wallet-browser-8fcaa2cf56936388ef8dfc528ecbd2354adb201e.tar.lz
tangerine-wallet-browser-8fcaa2cf56936388ef8dfc528ecbd2354adb201e.tar.xz
tangerine-wallet-browser-8fcaa2cf56936388ef8dfc528ecbd2354adb201e.tar.zst
tangerine-wallet-browser-8fcaa2cf56936388ef8dfc528ecbd2354adb201e.zip
Persist lost identities to storage for later analysis
Diffstat (limited to 'app/scripts/lib')
-rw-r--r--app/scripts/lib/4486-notifier.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/app/scripts/lib/4486-notifier.js b/app/scripts/lib/4486-notifier.js
new file mode 100644
index 000000000..b1b153419
--- /dev/null
+++ b/app/scripts/lib/4486-notifier.js
@@ -0,0 +1,29 @@
+class BugNotifier {
+ notify (message) {
+
+ postData('http://example.com/answer', {answer: 42})
+ .then(data => console.log(data)) // JSON from `response.json()` call
+ .catch(error => console.error(error))
+ }
+}
+
+function postData(url, data) {
+ // Default options are marked with *
+ return fetch(url, {
+ body: JSON.stringify(data), // must match 'Content-Type' header
+ cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
+ credentials: 'same-origin', // include, same-origin, *omit
+ headers: {
+ 'user-agent': 'Mozilla/4.0 MDN Example',
+ 'content-type': 'application/json'
+ },
+ method: 'POST', // *GET, POST, PUT, DELETE, etc.
+ mode: 'cors', // no-cors, cors, *same-origin
+ redirect: 'follow', // manual, *follow, error
+ referrer: 'no-referrer', // *client, no-referrer
+ })
+ .then(response => response.json()) // parses response to JSON
+}
+
+module.exports = BugNotifier
+