mstate-react
TypeScript icon, indicating that this package has built-in type declarations

1.6.4 • Public • Published

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'; // default system
  start?: boolean; // default true
  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-react';

You can also use the default export, since the named export is just a re-export from the Axios factory:

import Mstate from 'mstate-react';

Example

import Mstate from 'mstate-react';

<Mstate
  token="your-secret-key"
  instanceID="instance-id"
  workflow="workflow-name-with-path"
/>;

Package Sidebar

Install

npm i mstate-react

Weekly Downloads

15

Version

1.6.4

License

none

Unpacked Size

31.7 kB

Total Files

5

Last publish

Collaborators

  • mohit_ahirwal