npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@asyncflowstate/next

v3.0.0

Published

Next.js optimized integration for AsyncFlowState. Handle SSR, server actions, and app router transitions with declarative loading states.

Readme


Installation

pnpm add @asyncflowstate/next @asyncflowstate/react @asyncflowstate/core
# or
npm install @asyncflowstate/next @asyncflowstate/react @asyncflowstate/core

Transitions & Revalidation

useTransitionFlow

Perfect for React 19 and Next.js 15. Wraps execution in startTransition and provides automatic cache revalidation.

import { useTransitionFlow } from "@asyncflowstate/next";

const flow = useTransitionFlow(submitAction, {
  refresh: true, // router.refresh() on success
  revalidatePath: "/dash", // Declarative revalidation hint
  scrollToTop: true,
});

return (
  <button onClick={() => flow.execute()} disabled={flow.isPending}>
    {flow.isPending ? "Processing..." : "Submit"}
  </button>
);

Comprehensive Examples

1. Server Actions with Transitions

Native integration with React 19 / Next.js 15 useTransition for smooth navigation and automatic cache revalidation.

import { useTransitionFlow } from "@asyncflowstate/next";
import { updateProfileAction } from "./actions";

function ProfileForm() {
  const flow = useTransitionFlow(updateProfileAction, {
    revalidatePath: "/profile", // Automatic revalidation on success
    onSuccess: () => toast.success("Profile updated!"),
  });

  return (
    <form action={flow.execute}>
      <input name="username" />
      <button type="submit" disabled={flow.isPending}>
        {flow.isPending ? "Saving..." : "Save"}
      </button>
    </form>
  );
}

2. Edge-First Architecture

Optimized for the Edge Runtime. AsyncFlowState automatically leverages Edge Cache and detects environmental telemetry.

export const runtime = "edge";

const flow = useServerActionFlow(apiAction, {
  edge: {
    cache: "force-cache",
    ttl: 3600,
  },
});

3. AI-Powered: Speculative Navigation

Predict user navigation intent and pre-warm server action states before the user clicks.

const flow = useServerActionFlow(detailsAction, {
  predictive: { prefetchOnHover: true },
});

return (
  <Link href="/details" onMouseEnter={flow.prewarm}>
    View Details
  </Link>
);

4. Collaborative Server State: Cross-Tab Mesh

Synchronize Server Action results across multiple open tabs for the same user session.

const flow = useServerActionFlow(updateSettings, {
  crossTab: { sync: true, channel: "user-session-mesh" },
});

5. Multi-Step Server Sequences

Orchestrate complex server-side workflows with individual step tracking and aggregate progress.

const sequence = useFlowSequence([
  { name: "Auth", flow: loginAction },
  { name: "Sync", flow: syncAction },
]);

New in v3.0

  • Flow DNA: Self-healing Server Actions that optimize based on user patterns.
  • Speculative Navigation: Intent-based pre-fetching and execution.
  • Ambient ISR Monitoring: Background orchestration for incremental static regeneration.
  • Collaborative Server State: Real-time state synchronization across Next.js instances.
  • Edge-First Flows: Optimized integration with Next.js Edge Runtime.
  • Temporal Replay: Full history replay for complex multi-step Server Action flows.
  • Telemetry Dashboard: Live monitoring of Server Action health and performance.

License

MIT