spark.client.getGlobalState
function getGlobalState(): SparkState | nullGet the current global worker state (for debugging).
Returns internal state including exposed values, history, status, readiness, and any errors. Useful for inspection and debugging, but not needed for normal usage.
Returns
SparkState | null– Current state or null if not initializedExamples
const state = getGlobalState();
if (state) {
console.log('Worker values:', state.values);
console.log('Worker status:', state.status);
console.log('Worker error:', state.error);
}Use for debugging only