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

color-manager-redux

v0.1.2

Published

A Redux Client Module desigend to demonstrate BDD techniques with Redux.

Readme

BDD Redux Client - The Color Manager

This is a example of a redux client that was developed using BDD. This client allows users to add and remove colors from a list.

Installation

npm install --save color-manager-redux

-or-

yarn add color-manager-redux

Creating Color Stores

Creating a basic store

This is an example of how to create a store and dispatch an ADD_COLOR action using an action creator.

import { storeFactory, actions } from 'color-manager-redux'

const store = storeFactory()

store.dispatch(
  actions.addColor('sample color', '#ACA' )
)

console.log(
  store.getState()
)

Creating a store with an initial state

This is an example of how to create a store with a few initial colors:

import { storeFactory, actions } from 'color-manager-redux'

let initialState = {
  colors: [
    { name: 'rad red', hex: '#FF0000' },
    { name: 'lawn', hex: '#00FF00' },
    { name: 'ocean', hex: '#0000FF' }
  ]
}

const store = storeFactory(initialState)

store.dispatch(
  actions.removeColor('lawn')
)

console.log(
  store.getState()
)

Injecting middleware into the store

This is an example of how to inject middleware, like logging into the store.

note: Stores already incorporate redux-thunk

import { storeFactory, actions } from 'color-manager-redux'

const myLogger = store => next => action => {
  console.log('-------------> ', action.type, action.payload)
  return next(action)
}

const store = storeFactory({}, [myLogger])

store.dispatch(actions.addColor('lawn', `#00FF00`))
store.dispatch(actions.addColor('ocean', `#0000FF`))
store.dispatch(actions.removeColor('lawn'))

console.log(
  store.getState()
)

Errors

At present the only display error that is recorded is when a user tries to remove a color that does not exist:

import { storeFactory, actions } from 'color-manager-redux'

const store = storeFactory()

// Will dispatch an ERROR action and add an error to state for display
store.dispatch(actions.removeColor('lawn'))

console.log(
  store.getState()
)

Give it a Shot

I am accepting pull requests that include creative ways to extend this client. This is a place where you can test out BDD. Your pull request must include: a cucumber feature or scenario, some jest unit tests, and README.MD instructions on how to use your new feature.