Overrides an existing state schema in the swarm system with a new or partial schema.
This function updates the configuration of a state identified by its stateName, applying the provided schema properties.
It operates outside any existing method or execution contexts to ensure isolation, leveraging beginContext for a clean execution scope.
Logs the override operation if logging is enabled in the global configuration.
If the state schema service encounters an error during the override operation (e.g., invalid stateName or schema).
Example
// Override a state’s schema with new properties overrideState({ stateName:"UserPreferences", persist:true, getDefaultState: () => ({ theme:"dark" }), }); // Logs the operation (if enabled) and updates the state schema in the swarm.
Overrides an existing state schema in the swarm system with a new or partial schema. This function updates the configuration of a state identified by its
stateName, applying the provided schema properties. It operates outside any existing method or execution contexts to ensure isolation, leveragingbeginContextfor a clean execution scope. Logs the override operation if logging is enabled in the global configuration.