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

@composable-svelte/core

v0.4.3

Published

A Composable Architecture for Svelte 5 - Type-safe state management with reducers, effects, and navigation

Downloads

1,041

Readme

@composable-svelte/core

A Composable Architecture for Svelte 5 - Type-safe state management with reducers, effects, and navigation

npm version License: MIT TypeScript Svelte 5

Inspired by The Composable Architecture (TCA) from Swift/iOS, adapted for Svelte 5 and TypeScript.

Features

  • Pure Reducers: Predictable state management with (state, action, deps) => [newState, effect]
  • Declarative Effects: Side effects as data structures (run, fireAndForget, batch, merge, cancel)
  • Composability: Nest and scope reducers like Lego blocks
  • Collection Management: forEach combinator for managing dynamic arrays of child features (92% less boilerplate)
  • Type-Safe Navigation: State-driven navigation with Modal, Sheet, Drawer, Alert, NavigationStack
  • Internationalization: Complete i18n with ICU MessageFormat, locale detection, framework formatters
  • Server-Side Rendering: Production-ready SSR with Fastify, state hydration, security hardening
  • Static Site Generation: Multi-locale SSG with dynamic routes and build-time optimization
  • Svelte 5 Runes: Full integration with Svelte's reactivity system (`$state`, `$derived`)
  • TestStore: Exhaustive action testing with send/receive pattern
  • Complete Backend: API client, WebSocket, Storage, Clock dependencies
  • 73+ Components: shadcn-svelte integration with reducer-driven patterns
  • URL Routing: Browser history sync with pattern matching
  • 500+ Tests: Comprehensive test coverage across all modules

Installation

```bash npm install @composable-svelte/core

or

pnpm add @composable-svelte/core

or

yarn add @composable-svelte/core ```

Peer Dependencies: Svelte 5.0.0 or higher

Quick Start

1. Define Your State and Actions

```typescript import { createStore, Effect } from '@composable-svelte/core';

interface CounterState { count: number; isLoading: boolean; }

type CounterAction = | { type: 'increment' } | { type: 'decrement' } | { type: 'incrementAsync' } | { type: 'incrementCompleted' }; ```

2. Create a Reducer

```typescript const counterReducer = ( state: CounterState, action: CounterAction, deps: {} ): [CounterState, Effect] => { switch (action.type) { case 'increment': return [{ ...state, count: state.count + 1 }, Effect.none()];

case 'decrement':
  return [{ ...state, count: state.count - 1 }, Effect.none()];

case 'incrementAsync':
  return [
    { ...state, isLoading: true },
    Effect.run(async (dispatch) => {
      await new Promise(resolve => setTimeout(resolve, 1000));
      dispatch({ type: 'incrementCompleted' });
    })
  ];

case 'incrementCompleted':
  return [
    { ...state, count: state.count + 1, isLoading: false },
    Effect.none()
  ];

} }; ```

3. Create the Store

```typescript const store = createStore({ initialState: { count: 0, isLoading: false }, reducer: counterReducer, dependencies: {} }); ```

4. Use in Svelte Component

```svelte

Documentation

Comprehensive documentation is available in the `docs/` directory:

Examples

See the `examples/` directory for working examples:

Contributing

Contributions are welcome! This project follows a specification-first approach. See CLAUDE.md for contributor guidelines.

License

MIT License - see LICENSE for details.

Acknowledgments

Heavily inspired by The Composable Architecture by Point-Free. Adapted for Svelte 5 and TypeScript with love.

Links