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

reactive-properties

v0.1.12

Published

Reactive property system.

Readme

NPM CircleCI License

reactive-properties

A lightweight alternative for RX and Redux, that utilises react hooks and dramatically reduces the amount of boiler plate code for the typical React application.

Installation

npm install --save reactive-properties
yarn add reactive-properties

Documetation

Property

interface Property<T> {
  
  get(): T // returns the current value

  subscribe(callback: () => void): () => void // subscribe to future values

}

Property is just a variable that can be observed.

To get the current value use the get method. To subscribe to future updates, use the subscribe method. Subscribe returns a function which can be called to unsubscribe from updates.

Piping

For developer convenience all properties have a pipe method. It can be used to apply operators to a property.

property.pipe(
  withEffect(() => { ... }),
  map(x => x * 2),
)

State

Simplest property implementation. You provide the default value and can call the set method to update the value.

const state = new State(5)

console.log(state.get()) // prints 5

state.set(42)

console.log(state.get()) // prints 42

state.subscribe(() => console.log('Update:', state.get()))

state.set(99) // "Update: 99" is printed to the console

Sends update notifications to all subscribers when the new value is set.

combine

Used to combine multiple properties into one.

const a = new State(2)
const b = new State(2)

const sum = combine([a, b], (a, b) => a + b) // sum is 4

b.set(5) // sum is now 7

a.set(6) // sum is now 11

Updates every time when one of the source properties update.

map operator

Works similarly to Array.map. Creates a new property which will always have values that are obtained by mapping the original property's values with the provided function.

withEffect operator

Provides a way to add custom imperative logic when something starts observing the property.

property.pipe(
  withEffect(() => {
    console.log('Property started to be observed')

    return () => console.log('All observers unsubscribed')
  })
)

Works similarly to React's useEffect. Can be usefull to start and stop background tasks when user visits a specific page, for example.

forEach operator

Calls provided callback for each value that a property has. Including the current one.

waitFor operator

Converts the property to a promise that resolves when the provided predicate returns true. Promise resolves with the first value that matched the predicate.

dedupBy operator

Stops updates when property values don't change. Example:

const state = new State(0)

state.forEach(console.log) // prints 0

state.set(0) // nothing printed

state.set(1) // prints 1

state.set(1) // nothing printed