Skip to main content
The Observe Property command (Command Type: 12) monitors changes on a specified property in an object within the browser’s window context. It overrides the getter/setter for the property to capture real-time updates.

Command Type

Command Type ID: 12

Parameters

ParameterTypeDescriptionRequired
keystringThe name of the property to observe within the target objectYes
namestringA unique identifier for this listenerYes
parentObjectPathstringDot-path to the parent object in the window contextYes
timeoutnumberTimeout in millisecondsYes
correlationIdstringUnique identifier to correlate events triggered by this observerNo
sendOnChangeArray of NamedGetWindowDataCommandParamsAdditional data to send when the observed property changesNo

Usage Examples

Observe a State Property

{
  "command": "observe-property",
  "params": {
    "key": "currentOdds",
    "name": "oddsObserver",
    "parentObjectPath": "app.state",
    "timeout": 60000
  }
}

Observe with Additional Data Fetch

{
  "command": "observe-property",
  "params": {
    "key": "selectedEvent",
    "name": "eventObserver",
    "parentObjectPath": "window.store",
    "timeout": 30000,
    "sendOnChange": [
      {
        "name": "eventDetails",
        "timeout": 5000,
        "params": { "path": ["store", "eventDetails"], "timeout": 5000 }
      }
    ]
  }
}