API Documentation

for 0.0.1
Show:

LoadRequest Class

LoadRequest object encapsulates a request of a loader

Constructor

LoadRequest

(
  • params
)

Parameters:

  • params Object

    The parameters object

    • consume Function

      A function to be called (with this request as an argument) to consume the request

    • [onStart= null] Function optional

      A function to be called when the loading starts

    • [onLoad= null] Function optional

      A function to be called when the loading finishes

    • [onError= null] Function optional

      A function to be called when the loading fails

Item Index

Properties

Methods

consume

()

Launch the associated Ajax request

getError

() Mixed

Get the error that occured if any

Returns:

Mixed:

error

getValue

() Mixed

Get the value of this LoadRequest

Returns:

Mixed:

value

setError

(
  • error
)

Set the error that occured if any

Parameters:

  • error Mixed

setValue

(
  • value
)

Set the value of this LoadRequest. Will be filled after loading completion

Parameters:

  • value Object

Properties

complete

Unknown private final static

A status indicating that the loader has finished consuming all requests

loading

Unknown private final static

A status indicating that the loader has started consuming requests

pending

Unknown private final static

A status indicating that the loader has not yet started consuming requests

Events

complete

Fired when all the Loader's request have finished loading (whether successfully or not)

Event Payload:

  • requests Array

    The list of consumed requests

error

Fired by a LoadRequest when it has failed loading

Event Payload:

  • error String

    The error

error

Fired when one of the Loader's requests has failed loading

Event Payload:

load

Fired by a LoadRequest when it has successfully finished loading

Event Payload:

  • value Mixed

    The loaded and processed value

load

Fired when one of the Loader's requests has finished loading

Event Payload:

start

Fired by a LoadRequest when it has started loading