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

@inglorious/store

v12.9.6

Published

A state manager for real-time, collaborative apps, inspired by game development patterns and compatible with Redux.

Readme

Inglorious Store

NPM version License: MIT

An entity-based state store, inspired by game engines and compatible with Redux's tooling. State is a map of plain entities, behavior lives in types, and everything that happens is an event.

Documentation

Install

pnpm add @inglorious/store

In a few lines

import { createStore } from "@inglorious/store"

const types = {
  TodoList: {
    todoAdd(entity, text) {
      entity.todos.push({ id: Date.now(), text, isDone: false })
    },
  },
}

const entities = {
  work: { type: "TodoList", todos: [] },
  personal: { type: "TodoList", todos: [] },
}

const store = createStore({ types, entities })

store.notify("todoAdd", "Buy milk") // every TodoList
store.notify("#work:todoAdd", "Finish report") // only `work`
  • An entity is a plain object with an id and a type. A type is an object of event handlers, handler(entity, payload, api), which mutate the entity they are given; Mutative turns the mutation into a new immutable state.
  • An event reaches every entity whose type handles it, or one type ("TodoList:todoAdd"), or one entity ("#work:todoAdd"). Handlers notify further events through api.notify, and the queue applies them in order, one transaction each.
  • Entities have a lifecycle: add and remove run their create and destroy, where a type opens and closes what it needs from the outside world.

What's in it

  • handleRequest and handleAsync: the lifecycle of an async call as events, with status and error kept on the entity, outdated answers dropped, and optimistic updates.
  • fsm and scenes: a type that answers events by state, and the entities that stand in each state.
  • withStorage: fields kept in local storage as a byproduct of the entity.
  • Systems and middlewares: handlers that see every entity at once, and functions that wrap the store.
  • compute: memoized derived state, with createSelector as its Redux-compatible alias.
  • Redux DevTools and react-redux: the store has subscribe, getState and dispatch, so a React app can adopt it as its Redux store first and move its components to Inglorious Web later. @inglorious/react-store adds useEntity and useNotify.
  • Testing: trigger(entity, handler, payload) runs a handler and returns the new entity and the events it notified, with no store.
  • TypeScript: typed entities, handlers, payloads and events, with no casts.

Two rules

  • A handler writes to the entity it is given, before its first await. The entity is a draft that lives until the update ends; after an await, notify an event that does the writing, or use handleRequest.
  • An event's handlers read the state as the previous event left it. Whatever order they run in, they see the same world, and the next event sees what they changed.

Where it goes

Standalone, in a React app through react-redux or @inglorious/react-store, under Inglorious Web for the DOM, under Inglorious Engine for games, or on a server with @inglorious/server for multiplayer.

License

MIT © Matteo Antony Mistretta