Structure of the application

The application follows a standard React Hook approach.

Props

The following props are provided:

  • readPoint: Information on the Read Point: it's name, id, etc.
  • state: Information on the current state of the Read Point.
  • events: Real-time streaming events can be subscribed to using this object, for example actions.
  • api: API object to work with the Harmony API.
  • functions: Utility functions designed to assist your application in performing various tasks.
  • workspaceId: String containing the ID of the current workspace.
  • harmonyConsole: The harmonyConsole is a wrapper around the browsers debugging console. It stores the the data written to the console. The logging can be seen on the log page of a Read Point.
import React from 'react'

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

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

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