a zip code crypto-currency system good for red ONLY

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. /*globals __resourceQuery */
  6. if(module.hot) {
  7. var hotPollInterval = +(__resourceQuery.substr(1)) || (10 * 60 * 1000);
  8. var log = require("./log");
  9. var checkForUpdate = function checkForUpdate(fromUpdate) {
  10. if(module.hot.status() === "idle") {
  11. module.hot.check(true).then(function(updatedModules) {
  12. if(!updatedModules) {
  13. if(fromUpdate) log("info", "[HMR] Update applied.");
  14. return;
  15. }
  16. require("./log-apply-result")(updatedModules, updatedModules);
  17. checkForUpdate(true);
  18. }).catch(function(err) {
  19. var status = module.hot.status();
  20. if(["abort", "fail"].indexOf(status) >= 0) {
  21. log("warning", "[HMR] Cannot apply update.");
  22. log("warning", "[HMR] " + err.stack || err.message);
  23. log("warning", "[HMR] You need to restart the application!");
  24. } else {
  25. log("warning", "[HMR] Update failed: " + err.stack || err.message);
  26. }
  27. });
  28. }
  29. };
  30. setInterval(checkForUpdate, hotPollInterval);
  31. } else {
  32. throw new Error("[HMR] Hot Module Replacement is disabled.");
  33. }