@stackflow/compat-await-push
TypeScript icon, indicating that this package has built-in type declarations

1.1.13 • Public • Published

@stackflow/compat-await-push

Usage

import { receive } from "@stackflow/compat-await-push";

const MyActivity = () => {
  const { push } = useFlow();

  const onClick = async () => {
    const data = await receive(
      push("NextActivity", {
        // ...
      }),
    );

    console.log(data);
  };
};
import { send } from "@stackflow/compat-await-push";

const NextActivity = () => {
  const { id } = useActivity();
  const { pop } = useFlow();

  const onClick = async () => {
    pop();
    send({
      activityId: id,
      data: {
        hello: "world",
      },
    });
  };
};

Dependencies (0)

    Dev Dependencies (8)

    Package Sidebar

    Install

    npm i @stackflow/compat-await-push

    Weekly Downloads

    450

    Version

    1.1.13

    License

    MIT

    Unpacked Size

    7.36 kB

    Total Files

    18

    Last publish

    Collaborators

    • orionmiz
    • irrationnelle
    • tonyfromundefined