JS library_operation - gd-99/symbiogd GitHub Wiki

An operation.

Since 1.0beta3.

Child of [Webos.Observable](JS library_observable).

Methods

  • started() : Check if this operation is started. Returns: Boolean
  • progress() : Get this operation's progress. Returns: Number
  • completed() : Check if this operation is completed. Returns: Boolean
  • result() : Get this operation's result. Returns: Object
  • failed() : Check if this operation is failed. Returns: Boolean
  • setStarted() : Mark this operation as started.
  • setProgress(value) : Set this operation's progress.
  • Number value This operation's progress, in percentages.
  • setCompleted(result, [data]) : Mark this operation as completed.
  • __ result This operation's result. False values will mark the operation as failed.
  • __ [data] This operation's result data, if not provided as first argument.
  • addCallbacks(callbacks) : Add callbacks to this operation.
  • [Webos.Callback](JS library_callback) callbacks The callbacks,
  • abort() : Abort this operation.
  • pause() : Pause this operation.
  • resume() : Resume this operation.
  • always(callback) : Execute a callback then this operation is completed (success or error). Returns: Object
  • Function callback The callback.
  • done(callback) : Execute a callback then this operation succeeds. Returns: Object
  • Function callback The callback.
  • fail(callback) : Execute a callback then this operation fails. Returns: Object
  • Function callback The callback.
  • then(doneFilter, failFilter, progressFilter) : Execute a callback then this operation succeeds, fails and progresses. Returns: Object
  • Function doneFilter The callback to execute when the operation succeeds.
  • Function failFilter The callback to execute when the operation fails.
  • Function progressFilter The callback to execute when the operation progresses.

Static methods

  • [Webos.Operation](JS library_operation) Operation.create() : Create a new operation.
  • [Webos.Operation](JS library_operation) Operation.multiple(length) : Create a multiple operation. The method setCompleted() must be called several times.
  • Number length The number of sub-operations.
  • [Webos.Operation](JS library_operation) Operation.createCompleted() : Create a new completed operation.
  • [Webos.Operation.Group](JS library_operation.group) Operation.group(observables) : Put operations in a group.
  • Array|[Webos.Operation](JS library_operation) observables Operation(s).
⚠️ **GitHub.com Fallback** ⚠️