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

@frondruntime/sorus-effect

v0.3.1

Published

Sorus on Effect Schema: checked boxes, model classes, decoding, and Effect programs.

Readme

@frondruntime/sorus-effect

Sorus on Effect Schema, for an application already on Effect. Sorus is a glitch-free reactive state library for applications; this package adds checked data. It emphasizes:

  • Checked writes. A Box.schema or Model.boxField checks every write against its schema, and a value the schema rejects throws. When that error leaves the recipe, the update is undone; a recipe that catches it keeps its other writes.
  • Models from the wire. Model.decode(realm, schema)(input) makes a Model.Schema class, with boxes and keyed collections as fields, from wire data, and throws a DecodeError when the input does not fit.
  • Effect programs over state. Watchers and change streams that live for the caller's scope (Program.watchScoped, Program.changes), and stages that live for one section and apply when it succeeds (Stage.scoped).
  • One import. It re-exports every name of @frondruntime/sorus as it is, so Box.make, Collection.make, and Model.Class check nothing here either.

This package is opt-in: @frondruntime/sorus and @frondruntime/sorus-react import nothing from Effect, and an application without Effect never installs it. @frondruntime/sorus and effect 4.1 or a later 4.x are peer dependencies. Sorus is before 1.0: any release may change the API. It was called Pinna through 0.2.1.

Packages

| Package | Purpose | | --- | --- | | @frondruntime/sorus | The main package: realms, boxes, computed values, atoms, keyed collections, models, views, stages, atomic updates, and watchers. No Effect. | | @frondruntime/sorus-react | React hooks: useValue, useValues, useSelect. React 19 or later. | | @frondruntime/sorus-effect | Opt-in, for an application already on Effect: boxes that check an Effect Schema on every write, models decoded from the wire, and Effect programs that react to state. effect 4.1 or a later 4.x. | | @frondruntime/sorus-core | The raw reactive graph (cells, derived values, atoms, watchers, reactions) with no runtime dependencies, for code that builds on the graph itself. |

Quick start

| Package manager | Command | | --- | --- | | Bun | bun add @frondruntime/sorus @frondruntime/sorus-effect effect | | npm | npm install @frondruntime/sorus @frondruntime/sorus-effect effect | | pnpm | pnpm add @frondruntime/sorus @frondruntime/sorus-effect effect | | Yarn | yarn add @frondruntime/sorus @frondruntime/sorus-effect effect |

import { Schema } from "effect";
import { Computed, Model, Realm } from "@frondruntime/sorus-effect";

const realm = Realm.make();

class Todo extends Model.Schema<Todo>("Todo")({
  id: Schema.String,
  title: Schema.String,
  $done: Model.boxField(Schema.Boolean), // a box field; the wire key is "done"
}) {
  readonly $label = Computed.make(this.realm, (read) =>
    read(this.$done) ? `✓ ${this.title}` : this.title,
  );

  toggle(): void {
    Realm.update(this.realm, (read, write) => {
      write(this.$done, !read(this.$done));
    });
  }
}

// Throws a DecodeError, holding the SchemaError, when the input does not fit.
const todo = Model.decode(realm, Todo)({ id: "1", title: "Write the docs", done: false });

todo.toggle();
const label = Realm.untracked(realm, (read) => read(todo.$label)); // "✓ Write the docs"

A single checked box is Box.schema(realm, Schema.Number, 0). The check has a cost: over seven runs the schema path took 3.3 to 7.5× the plain path's time to build 10,000 rows, 7.2 to 12.4× to decode, and 2.5 to 3.8× on toggleAll. Sorus does not skip the check or the tracking for speed, so data that needs no check goes in a plain Box.make or Model.Class.

Exports

Everything @frondruntime/sorus exports, and:

| Kind | Exports | | --- | --- | | Checked state | Box.schema, Collection.schema, Collection.reconcile, whose equals defaults to the schema's | | Models | Model.Schema, Model.boxField, Model.collectionField, Model.context, Model.decode, Model.restore | | Effect programs | RealmService, Realm.scoped, Program.watchScoped, Program.changes, Program.updates, Program.fromStream, Program.fromEffect, Program.whileObserved, Source.observeScoped, Stage.scoped, View.orderedScoped, View.groupedScoped, View.totalsScoped | | Errors | DecodeError |

Documentation

https://sorus.frondruntime.dev/docs/effect/boxes