Skip to content

Latest commit

 

History

History
51 lines (34 loc) · 1.18 KB

File metadata and controls

51 lines (34 loc) · 1.18 KB

react-sidefx

Warning

This project is experimental and not ready for production use. Its API may change without notice.

A collection of React primitives for managing side effects — built for React 19 with Suspense, concurrent features, and modern patterns in mind.

Philosophy

Most side effect patterns in React are either too low-level (raw useEffect) or too opinionated (full data-fetching libraries). react-sidefx sits in between — small, composable primitives that do one thing well and get out of your way.

Installation

npm install react-sidefx

What's inside

createResource

A Suspense-native async primitive with built-in caching. No loading states, no useEffect, no boilerplate — just your data.

import { createResource } from "react-sidefx";
import { Suspense } from "react";

const userResource = createResource(getUser, "user");

function UserProfile() {
  const user = userResource.use("user-123");
  return <h1>{user.name}</h1>;
}

export default function App() {
  return (
    <Suspense fallback="Loading...">
      <UserProfile />
    </Suspense>
  );
}

Requirements

  • React 19+
  • TypeScript 5+ (recommended)

License

MIT