MState is a library designed to automate workflows by managing state transitions and actions efficiently. It enables developers to create state machines, which are useful for defining and controlling the various states an object or process can pass through, especially in complex workflows.
interface MStateProps {
token: string;
workflow: string;
theme?: 'dark' | 'light' | 'system';
start?: boolean;
who?: string;
instanceID?: string;
onInstanceChange?: (value: string) => void;
updateCustomFieldValue?: (key: string) => unknown;
}
Once the package is installed, you can import the library using import or require approach:
import { Mstate } from 'mstate-executor';
You can also use the default export, since the named export is just a re-export from the Axios factory:
import Mstate from 'mstate-executor';
Example
import Mstate from 'mstate-executor';
<Mstate
token="your-secret-key"
instanceID="instance-id"
workflow="workflow-name-with-path"
/>;