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

redux-back

v1.0.2

Published

A lightweight middleware for enabling Back and Forward browser controls for a Single/Multi-page Web Application

Downloads

3

Readme

redux-back

A lightweight middleware for enabling Back and Forward browser controls for a Single/Multi-page Web Application.

This middleware will record action objects in the browser history stack, replaying the action when user navigates back or forward with browser navigation.

If you already have some screen management with pure redux actions, then this will give you browser history with 0 new actions and no configuration beyond calling the createBackMiddleware function.

I used this for subscreen changes that didn't warrant a change in url but wanted the intuitive back action to be available.

Installation

$ npm install --save redux-back

Example

import {applyMiddleware} from 'redux'
import {createBackMiddleware} from 'redux-back'

const landingPage = {type: EXAMPLE_OPEN_LANDING_PAGE_Action, welcomeMessage: 'Welcome'}
const reduxBack = createBackMiddleware(landingPage, [EXAMPLE_Action1, EXAMPLE_Action2])

let store = createStore(reducers, loadedState, applyMiddleware(...middleware, reduxBack))

It can be used with require as

const {createBackMiddleware} = require('redux-back')

The above code will add actions of type EXAMPLE_Action1 and EXAMPLE_Action2 to the browser back and forward buttons.

The EXAMPLE_OPEN_LANDING_PAGE_Action provided to the creation script will be used when the user clicks back to the first screen of the session. If any action objects in browser history are null, they won't be dispatched.