Skip to content

Instantly share code, notes, and snippets.

@LosantGists
Last active July 22, 2020 19:06
Show Gist options
  • Select an option

  • Save LosantGists/8a7cfe0b9bd75be06c7437a95510127e to your computer and use it in GitHub Desktop.

Select an option

Save LosantGists/8a7cfe0b9bd75be06c7437a95510127e to your computer and use it in GitHub Desktop.
const data = [
{"location":"39.108314,-84.50959","isMoving":"1", "bearing":"SW","refrigeratorTemp":"35","freezerTemp":"2”},
{"location":"39.107442,-84.50956","isMoving":"1", "bearing":"SSE","refrigeratorTemp":"38","freezerTemp":"5”},
{"location":"39.106,-84.509303","isMoving":"1", "bearing":"SSE","refrigeratorTemp":"36","freezerTemp":"1},
{"location":"39.105279,-84.508983","isMoving":"1", "bearing":"SSE","refrigeratorTemp":"35","freezerTemp":"-7”},
{"location":"39.104119,-84.508712","isMoving":"1", "bearing":"SSE","refrigeratorTemp":"40","freezerTemp":"-9”},
.
.
.
.
{"location":"39.107812,-84.509727","isMoving":"1", "bearing":"NNW","refrigeratorTemp":"49","freezerTemp":"0"},
{"location":"39.108314,-84.50959","isMoving":"0", "bearing":"HQ","refrigeratorTemp":"49","freezerTemp":"2"}
]
const i = payload.dataIndex
payload.simState = data[i]
payload.newIndex = i < data.length - 1 ? i + 1 : 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment