new Loader()
A class to load a file. This wraps a standard AJAX method and
Includes an xmit instance to more easily handle events.
the fetch command performs the load and also returns a promise.
This unit (src/loader.js) is a pseudo class. This is meant to be compiled with browserify and aliasify. If DEV_MODE environment variable is set to FINAL, this class will load _LoaderAtom class, which contains no parameter validations. Otherwise it will load _Loader class which does.
This unit (src/loader.js) is a pseudo class. This is meant to be compiled with browserify and aliasify. If DEV_MODE environment variable is set to FINAL, this class will load _LoaderAtom class, which contains no parameter validations. Otherwise it will load _Loader class which does.
Methods
(static) _on_error()
internal use function to unlock the loader if
a fetch (load) is throws an error.
(static) _on_load()
internal use function to unlock the loader if
a fetch (load) is completed.
(static) error(lambda) → {object}
the calback method
Parameters:
| Name | Type | Description |
|---|---|---|
lambda |
function | (optional) |
Returns:
loader instance for continuations
- Type
- object
(static) fetch(url, method) → {object}
the method to use when loading. If none, uses this._method
Parameters:
| Name | Type | Description |
|---|---|---|
url |
string | (optional) |
method |
string | (optional) |
Returns:
Promise
- Type
- object
(static) loaded(lambda) → {object}
the calback method
Parameters:
| Name | Type | Description |
|---|---|---|
lambda |
function | (optional) |
Returns:
loader instance for continuations
- Type
- object
(static) on(channel_name, lambda) → {object}
the calback method
Parameters:
| Name | Type | Description |
|---|---|---|
channel_name |
* | |
lambda |
function | (optional) |
Returns:
loader instance for continuations
- Type
- object