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

redux-view-binder

v0.0.10

Published

Bind your web-components views easily with redux

Readme

redux-view-binder

Build Status Coverage Status Bind your web-component views easily with Redux (no React, no Polymer).

Binding Views

Redux is a very nice library to centralize the management of the state of your application. The goal of redux-view-binder is to provide a small helper to 'bind' your views to your Redux state changes. Simply said, it means refreshing your views based on the changes of your Redux state automatically.

If you are using React, you might want to have a look at react-redux which provide this capability and more. Redux-view-binder is framework agnostic and can be used with any View library.

Quick example, let's imagine we have a todolist view, where we display a list of todos. Inside our Redux state we have a todos field.

// Import ReduxViewBinder in case of es module
import ReduxViewBinder from 'redux-view-binder';

// Create binder using store from Redux
const binder = new ReduxViewBinder(store);

//... some time later
//retrieve the web component
let todoList = document.querySelector('#todolist');

//bind the component to Redux state changes
binder.bind(
    (state) => { return state.todos; }, //only watch changes of todos field.
    (todos) => { // the watch field is passed to the onChange method.   
        //if todos field has changed then we should refresh  the todoList view
        todoList.refresh(todos);
    }
);

Optional parameters

Here is the bind method signature

bind(watch, onChange, [view], [filter])

In some cases you want to pass the view to the binder, the view will be provided to the onChange method as the second parameter.

In some other case you want to pass to the onChange method another field from the Redux state object than the one that is watched. In that case the filter method can be used.

Example of usage

// Import ReduxViewBinder in case of es module
import ReduxViewBinder from 'redux-view-binder';

// Create binder using store from Redux
const binder = new ReduxViewBinder(store);

//... some time later
//retrieve the web component
let todoList = document.querySelector('#todolist');

//... some time later
//bind the component to Redux state changes
binder.bind(
    (state) => { return state.todos; }, //only watch changes of todos field.
    (state, view) => { // the watch field is passed to the onChange method.   
        //if todos field has changed then we should refresh  the todoList view
        view.refresh(state.todos);
    },
    todoList, //pass the view object, will be passed to the onChange method as second parameter
    (state) => { return state; } // passing the full state object instead of only the todos field
);