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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@zedux/atoms

v1.2.0

Published

A Molecular State Engine for React

Downloads

2,730

Readme

@zedux/atoms

The core atomic model of Zedux. This is a standalone package, meaning it's the only package you need to install to use Zedux's atomic model. It includes the Zedux core store package as well as all APIs related to atoms and ecosystems.

This package is framework-independent, though many of its APIs are heavily inspired by React.

If you're new to Zedux, you're probably looking for the quick start.

Installation

npm install @zedux/atoms # npm
yarn add @zedux/atoms # yarn
pnpm add @zedux/atoms # pnpm

If you're using React, you probably want to install the @zedux/react package instead, which includes everything from this package and more.

This package has a direct dependency on the @zedux/core package. If you install that directly, ensure its version exactly matches your @zedux/atoms version to prevent installing duplicate packages.

Usage

See the top-level README for a general overview of Zedux.

See the Zedux documentation for comprehensive usage details.

Basic example:

import { atom, createEcosystem } from '@zedux/atoms'

const greetingAtom = atom('greeting', 'Hello, World!')
const ecosystem = createEcosystem({ id: 'root' })

const instance = ecosystem.getInstance(greetingAtom)

instance.store.subscribe(newState => console.log('state updated:', newState))
instance.setState('Goodbye, World!')
instance.destroy()

Exports

This package includes and re-exports everything from the following package:

On top of this, @zedux/atoms exports the following APIs and many helper types for working with them in TypeScript:

Classes

Factories

Injectors

Utils

For Authors

If your lib only uses APIs in this package, it's recommended to only import this package, not @zedux/react. It's recommended to use a peer dependency + dev dependency on this package.

Contributing, License, Etc

See the top-level README for all the technical stuff.