Structure of the application

The application follows a pretty standard React Hook approach.

Props

The following props are provided:

  • readPoint: Information on the Read Point: it's name, id, etc.
  • events: Real-time streaming events can be subscribed to using this object, for example actions.
  • api: API object to work with the Harmony API.
  • harmonyConsole: Function to log information that can be of help debugging the application.
import React from 'react'

export default function Application({ readPoint, events, api, harmonyConsole }) {  
  useEffect(() => {
    harmonyConsole.log('Loading the application for readPoint', readPoint)
  })

  events.onAction = async (action) => {
    harmonyConsole.log('Received action', action)
  }

  return (
    <>
      Page contents...
    </>
  )
}