LogoRobo.js
Framework

getState()

Function: getState()

function getState(): IpcState | null

Gets the current IPC state from state.json written by the host.

Returns

IpcState | null

The IPC state or null if not available

Example

import { getState } from 'robo.js/ipc'

const state = getState()
if (state) {
  console.log(`Running in ${state.env.type}`)
}

On this page