WatchedValue

WatchedValue object is returned by some [[Trading Terminal]] methods. Using this object you can get/set 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 true the callback will be executed only once
    2. callWithLast - if it is true the callback will be executed with the previous value (if available)

unsubscribe(callback)

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

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容