@stackflow/plugin-stack-depth-change
TypeScript icon, indicating that this package has built-in type declarations

1.1.5 • Public • Published

@stackflow/plugin-stack-depth-change

Monitors a depth change in the stack.

Usage

import { stackflow } from "@stackflow/react";
import { stackDepthChangePlugin } from "@stackflow/plugin-stack-depth-change";

const { Stack, useFlow } = stackflow({
  activities: {
    // ...
  },
  plugins: [
    // ...
    stackDepthChangePlugin({
      /**
       * Initial loading
       * @param depth
       * @param activeActivities
       * @param activities
       */
      onInit: ({ depth, activities, activeActivities }) => {},
      /**
       * When the depth changes
       * @param depth
       * @param activeActivities
       * @param activities
       */
      onDepthChanged: ({ depth, activities, activeActivities }) => {},
    }),
  ],
});

Readme

Keywords

none

Package Sidebar

Install

npm i @stackflow/plugin-stack-depth-change

Weekly Downloads

554

Version

1.1.5

License

MIT

Unpacked Size

12.9 kB

Total Files

12

Last publish

Collaborators

  • orionmiz
  • irrationnelle
  • tonyfromundefined