OSDN Git Service

js: implement newslash.fail()
authorhylom <hylom@users.sourceforge.jp>
Thu, 31 Aug 2017 13:02:42 +0000 (22:02 +0900)
committerhylom <hylom@users.sourceforge.jp>
Thu, 31 Aug 2017 13:02:42 +0000 (22:02 +0900)
src/newslash_web/public/js/newslash.js

index dba2e0b..fa35af4 100644 (file)
@@ -13,6 +13,12 @@ function initNewslash() {
     };
   }
 
+  function fail(param) {
+    return new FakePromise(function (resolve, reject) {
+      return reject(param);
+    });
+  }
+
   Newslash.prototype.urlParse = function (url) {
     var parser = document.createElement('a');
     parser.href = url;