Skip to content

Latest commit

 

History

History
20 lines (12 loc) · 741 Bytes

WatchedValue.md

File metadata and controls

20 lines (12 loc) · 741 Bytes

WatchedValue object is returned by some methods of the Trading Terminal. Using this object you can get/set some value and be notified when the value is changed.

value()

Returns current value.

setValue(value)

Sets new value.

subscribe(callback, options)

  1. callback is a function to be called when the value is changed
  2. options is an object with the following properties:
    1. once - if it is set to true then the callback will be executed only once
    2. callWithLast - if it is set to true then the callback will be executed with the previous value (if available)

unsubscribe(callback)

Use the same function that you used in the subscribe function to unsubscribe from the updates.