FB.Waitable

Description

Representation of an object that is pending an asynchronous result.

Methods

add_changed(Function value)

Subscribe to event 'changed' Event to which functions should be registered in order to execute upon readiness.

onChange()

If a function is registered to be executed upon "IsReady", this calls it.

remove_changed(Function value)

Unsubscribe to event 'changed' Event to which functions should be registered in order to execute upon readiness.

waitForCondition(Function callback)

Watch for changes in ready state and result until condition is satisfied.

waitForValue(Object expectedValue,  Function callback)
waitUntilReady(Function callback)

If we don't need to wait, execute the callback, otherwise register it to an event that will fire once the necessary result is computed and ready.

Properties

Object  result

The actual result returned from server.