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

bricksy-rx

v0.2.1

Published

A lightweight, reactive state management library for TypeScript applications.

Readme

Bricksy: A zero boilerplate solution to state management

Bricksy is a lightweight, zero boilerplate reactive state management library for TypeScript applications, built on top of RxJs.

When to use Bricksy

  • Your app needs state management, but you don't need to go for a full blown state management library like NgRx or Redux.
  • You need a lightweight state management libary.

Features

  • 🚀 Zero Boilerplate: Simplify state management with minimal setup and configuration.
  • Reactive by Design: Built on top of RxJs, enabling powerful reactive programming capabilities.
  • 📦 Lightweight: Small footprint, perfect for projects that don't require heavy state management libraries.
  • 🌟 TypeScript Support: Fully typed for a better developer experience.
  • 🛠️ Redux DevTools Integration: Seamlessly integrates with Redux DevTools for state debugging.

Installation

To install Bricksy, you can use npm or yarn:

# Using npm
npm install bricksy-rx

# Using yarn
yarn add bricksy-rx

Usage

Usage

Here’s how you can use Bricksy to manage your application state:

1. createStore

The createStore() function initializes a new store with a default state.

import { createStore } from 'bricksy';

const store = createStore({ count: 0 });

2. setData()

The setData() method allows you to update the state in the store.

store.setData({ count: 5 });
console.log(store.snapshot()); // { count: 5 }

You can also setData with an update function.

store.setData(state => ({count: state.count + 1}));
console.log(store.snapshot()); // { count: 6 }

3. select$()

The select$() function enables you to extract observable "slices" of the state.

Selecting the entire state

const store$ = store.select$().subscribe((state) => {
    console.log('State updated:', state);
});

Selecting an observable slice of the state.

const store = createStore({
    user: {
        name: 'John Doe',
        age: 30,
    },
    settings: {
        theme: 'dark',
        notifications: true,
    },
});

const user$ = store.select$((state)=> state.user).subscribe((user) => {
    console.log('User updated:', user);
});

You can also declare a comparison function with select$() so that events are emitted only when the comparison function returns true.

const store = createStore({
    user: {
        id: 1,
        name: 'John Doe',
        age: 30,
    },
    settings: {
        theme: 'dark',
        notifications: true,
    },
});

const user$ = store.select$(
    (state)=> state.user, 
    (prevUser, currentUser)=> prevUser.id !== currentUser.id
    ).subscribe((user) => {
    console.log('User updated:', user);
});

// no event is emitted here, since the id has not been changed
store.setData((state) => ({...state, user: {...state.user, name: 'Jane Doe'}}));

// this will emit an event since the id has been changed
store.setData((state) => ({...state, user: {...state.user, id: 2, name: 'Jane Doe'}}));

4. registerAction()

The registerAction() method lets you define actions that can modify the state.

const store = createStore({ count: 5 });

store.registerAction('increment', (state, payload) => {
    return { ...state, count: state.count + payload.add };
});

const payload = { add: 2 };

store.dispatch('increment', payload);
console.log(store.getData()); // { count: 7 }

5. registerSideEffect()

The registerSideEffect() method allows you to define side effects that respond to state changes.

store.registerSideEffect('logCount', (state) => {
    console.log('Side effect triggered. Current count:', state.count);
});

store.setData({ count: 10 });
// Logs: Side effect triggered. Current count: 10

With these methods, Bricksy provides a simple yet powerful way to manage application state reactively.

License

MIT © Tharindu Ranaweera