resource-loader
Advanced tools
Comparing version 1.1.3 to 1.1.4
{ | ||
"name": "resource-loader", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"main": "./src/index.js", | ||
@@ -5,0 +5,0 @@ "description": "A generic asset loader, made with web games in mind.", |
@@ -13,3 +13,3 @@ # Resource Loader [![Build Status](https://travis-ci.org/englercj/resource-loader.svg?branch=master)](https://travis-ci.org/englercj/resource-loader) | ||
// chainable `add` to enqueue a resource | ||
.add(url, options) | ||
.add(name, url, options) | ||
@@ -27,4 +27,5 @@ // chainable `before` to add a middleware that runs for each resource, *before* loading a resource. | ||
// resources have loaded. | ||
.load(function (resources) { | ||
// resources is an array of resource objects that have a couple properties: | ||
.load(function (loader, resources) { | ||
// resources is an object where the key is the name of the resource loaded and the value is the resource object. | ||
// They have a couple default properties: | ||
// - `url`: The URL that the resource was loaded from | ||
@@ -31,0 +32,0 @@ // - `error`: The error that happened when trying to load (if any) |
@@ -273,2 +273,5 @@ var EventEmitter2 = require('eventemitter2').EventEmitter2, | ||
// set the request type and url | ||
xhr.open('GET', this.url, true); | ||
// set the responseType | ||
@@ -282,3 +285,2 @@ xhr.responseType = this.xhrType; | ||
xhr.open('GET', this.url, true); | ||
xhr.send(); | ||
@@ -285,0 +287,0 @@ }; |
47719
1047
68