I am sending a request to the firebase client SDK (JavaScript) which sends to the location of a vehicle in realtime..I get the following object

```
​{
  "bearing": 264.8562316894531,
  "latitude": "19.9742249",
  "longitude": "73.7910482",
  "timestamp": "1582103153697",
  "trip": "40be478c-b0b0-41fb-bc70-66b2507719ef",
  "user": "1985"
}

```

I want to be able to get the value before it changes so I can calculate the angle to rotate my marker(HEADING).

any help is appreciated