Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

simplified a ?: to a ||

  • Loading branch information...
commit edc2e6ae7a0ca5edd031b99890c65182945ed867 1 parent fa82371
unscriptable authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 examples/{tinyImageUploader.js → tinyImageLoader.js}
6 examples/tinyImageUploader.js → examples/tinyImageLoader.js
View
@@ -2,7 +2,7 @@
// promises. It's so simple, you could use the tiny.js
// or tiny2.js implementations.
-function imageUploader (src) {
+function imageLoader (src) {
var promise = new Promise(),
img = document.createElement('img');
img.onload = function () {
@@ -13,11 +13,11 @@ function imageUploader (src) {
};
img.src = src;
// if you're using tiny2.js, return promise.safe;
- return promise;
+ return promise.safe || promise;
}
// example usage:
-imageUploader('http://google.com/favicon.ico').then(
+imageLoader('http://google.com/favicon.ico').then(
function gotIt (img) {
document.body.appendChild(img);
},
Please sign in to comment.
Something went wrong with that request. Please try again.