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

@mocanvas/state

v4.11.0

Published

Signals for mocanvas: atoms, computed values, transactions and React bindings.

Readme

@mocanvas/state

The signals library behind mocanvas: atoms, computed values, transactions, reactors, and optional React bindings. No dependencies.

Install

npm install @mocanvas/state

React is an optional peer dependency; you only need it for the @mocanvas/state/react entry point.

Use

import { atom, computed, react } from "@mocanvas/state"

const count = atom("count", 1)
const doubled = computed("doubled", () => count.get() * 2)

const stop = react("log", () => console.log(doubled.get())) // 2
count.set(21) // 42

stop()

With React:

import { useValue, track } from "@mocanvas/state/react"

const Count = track(function Count() {
  return <span>{count.get()}</span>
})

// or, without wrapping the component:
function OtherCount() {
  return <span>{useValue(count)}</span>
}

ESM only. The rest of the family: @mocanvas/mocanvas (the batteries-included canvas), @mocanvas/editor, @mocanvas/store, @mocanvas/wasm, @mocanvas/sync and @mocanvas/compat.

License

Source-available, not open source. Free to use for:

  • personal, non-commercial projects;
  • non-profit organisations;
  • development, evaluation, testing and staging — including inside a for-profit company, so you can try it and build against it before committing;
  • teaching and academic research.

Shipping it in a commercial product, service or website needs a written agreement with us. That includes anything sold, anything that earns revenue directly or through advertising, and internal tools running a for-profit business.

To arrange one, or if you are unsure which side of the line you are on, write to [email protected] — we would rather answer the question than have you guess.

The full terms are in LICENSE, shipped in this package.