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 🙏

© 2025 – Pkg Stats / Ryan Hefner

redux-provider

v1.0.29

Published

Redux provider is an immutable store for api request responses built with redux and redux-sagas. Support for React and Angular is built-in.

Downloads

374

Readme

redux-provider

N|Crowdkeep

Redux provider is an immutable store for api request responses built with redux and redux-sagas. Support for React and Angular is built-in.

Features

  • React support
  • Angular support
  • Schema type serializations
  • Immutable store
  • API Tokenization
  • Tokenization
  • Model preloading
  • Request preloading
  • Reusuable redux type responses
  • Request transformation
  • Response transformation
  • Request cancellation
  • Paremeter serialization
  • Currently supports all HTTP request types
  • Authorization
  • Custom adapaters
  • Upload and Download progress statuses
  • Status Validations
  • WebSockets
  • Proxies

Usage

Provider

import Provider from 'redux-provider'

import { MyComponent } from './my-component'

import { Type } from './type' // example Type after this example

// need to update with dynamic importing
export const MyModel = new Provider({
  basePath: apiUrl,
  path: paths.PROVIDER_PATH, // basePath/path
  token: ACCESS_TOKEN,
  type: Type,
})

const myPreloadFunction = (params, enhance) => {
  const type = 'MY_REDUX_TYPE'
  const { someParam } = params

  MyModel.post(
    {
      component: MyComponent, // optional currently for React only
      type: type, // required
    },
    {
      params: {
        someParam: someParam,
        type: type, 
        /* 
          "type" param is not required, 
           but good practice for backend developers to connect what is going on frontend wise.
        */
      },
      transformResponse: enhance,
      /*
        not required, but extra filter on response other than type property filters
      */
    },
  )
}

// Optional preload function for multiple request types
export const preloadMyModel = (params, enhance) => {
  myPreloadFunction(params, enhance)
}

Provider Type


// Required response property types
const MyModel = {
  name: String,
  status: String,
  user: String,
  account: String,
  created_at: String,
  updated_at: String,
  guid: String,
}

// Optional response property types
const MyModelOptions = {
  rank: Number,
  count: Number,
}

export const Type = {
  defaults: MyModel,
  options: MyModelOptions,
}

React

import React from 'react'

import { MyModel, preloadMyModel } from '../../../providers'

class MyComponent extends React.PureComponent {
  constructor(props) { // not required
    super(props)
  }
  componentWillMount() {
    const params = {
      ...
    }
    preloadMyModel(params, (response, type) => {
      const { ... } = response
      if (type === 'SOME_TYPE_ONE') {
        ...
      } else if (type === 'SOME_TYPE_TWO') {
        ...
      } else if (type === 'SOME_TYPE_THREE') {
        ...
      }
      return response
    })
  }
}