spark.client.isWorkerInitialized
function isWorkerInitialized(): booleanCheck if the Spark worker has been initialized.
Returns true after the first call to useSpark(). Useful for
conditional setup or debugging.
Returns
boolean– True if worker is initialized and runningExamples
// Set up RPC handlers only if worker exists
if (isWorkerInitialized()) {
const state = getGlobalState();
console.log('Worker state:', state);
}