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

trippler

v0.0.2

Published

A React Router Redux implementation.

Downloads

5

Readme

Tripple R

A tool for integrating React Router and Redux. Controlling navigation vie state!

React Router

Is a library that allows you to match React Components to URL and build powerful full-scale applications.

Redux

Is a state management system that allows you to keep all your data in a central location, passing down to props.

Tripple R

Bridges the gap between React Router and Redux. It allows you to replay state over time over navigation.

Howto

Import the required modules

import TrippleR from "trippler";
import rrrMiddleware from "trippler";
import rrrReducer from "trippler";

Add rrrMiddleware and rrrReducer to your Redux store. Note: that "otherReducer" will be your reducers, it's just an example, not real. NOTE: Currently you MUST use compineReducers with a name of "rrr". It will NOT work if you use any other name. NOTE: Thunk middleware is just an example, it's not required.

let reducers = combineReducers({ rrr: rrrReducer, other: otherReducer });
const store = createStore(
  reducers, 
  applyMiddleware(rrrMiddleware, thunk)
);

Include the TrippleR Component to your application.

ReactDOM.render(<Router><Provider store={store}>
<div>
  <TrippleR />
  <App />
</div>
</Provider></Router>, document.getElementById('root'));

The final step is to use Redux dispatch action "navigateTo".
This will navigate you to the URL passed, for example, the "aboutUs" page.

import { navigateTo } from "trippler";
dispatch(navigateTo("/aboutUs"));

The rest is up to you. You can use any Redux implementation and React Router V4 you require.

Feedback

We are on the lookup for any feedback. Please file any issue on Github, or hit me up on twitter @gpltaylor

What does it all do?

TrippleR is the simplest Redux implementation, it gives you the power to control navigation using simple dispatch actions that are tracked over time.

TrippleR

A component that implements React Routers "Redirect". It's this that wires up navigating away. Because TrippleR using React Routers implementation, we will always work, even when React Router updates. The code base is VERY simple and is less than 50 lines of code in total! When you dispatch an action to navigate somewhere, the TrippleR Component will render a "Redirect" component and off the browser goes!

rrrReducer

A reducer that stores some required information needed for TrippleR to do it's thing. There's really nothing interesting going on here, but we need to make sure the Redirect Component is only visible when we want the user to redirect away.

rrrMiddleware

This resets the values within the store to "happy Defaults", allowing the navigation to work, the next time it's clicked.

navigateTo

This is an action that you passed to dispatch. This will allow you to hook into onClick events and navigate to any page of your choice.

import { navigateTo } from "trippler";
dispatch(navigateTo("/aboutUs"));

Coming Soon

  • Allow configuration to be passed into TrippleR
  • Allow throttle and debounce
  • Get feedback from the community