{"_id":"snapsheet-redux-helpers","_rev":"268-b038cab5abd0eaf56974d0cd8c286228","name":"snapsheet-redux-helpers","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"snapsheet-redux-helpers","version":"1.0.0","author":{"name":"Snapsheet Inc."},"license":"MIT","_id":"snapsheet-redux-helpers@1.0.0","maintainers":[{"name":"snapsheet","email":"tech@snapsheet.me"}],"homepage":"https://github.com/bodyshopbidsdotcom/redux-helpers#readme","bugs":{"url":"https://github.com/bodyshopbidsdotcom/redux-helpers/issues"},"ava":{"babel":{"babelrc":true},"files":["src/**/*.test.js"],"require":["./setupTestEnvironment.js"]},"dist":{"shasum":"e9d9d1fc455c76b59f414f5c49140889b44f5acf","tarball":"https://registry.npmjs.org/snapsheet-redux-helpers/-/snapsheet-redux-helpers-1.0.0.tgz","integrity":"sha512-DiAhm+U9HC1KJeT+0P9qy6kFXwib5mOgg8F9fRo1VznJE0sbdbGa08px3XHNDmHnYciEWw8EHYmDTC9yJI9hPQ==","signatures":[{"sig":"MEQCIBuHZQZ9hBGW3GwuoCrnFnBgQ/6XCtvlo4bPgdyqFncOAiAIvYR5b8sud2NuLZEe+sGr4kq2yCOydM/O53PGpyRvDQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/index","_from":".","files":["*.md","es6/*","es6/*/**","lib/*","lib/*/**","umd/*","umd/*/**","src/*","src/*/**"],"_shasum":"e9d9d1fc455c76b59f414f5c49140889b44f5acf","engines":{"node":">=6.9.x","yarn":">=0.18.0"},"gitHead":"52a07de4c10b78e13769fe861557dfc377794f86","scripts":{"tdd":"ava --watch","demo":"webpack-dev-server --progress --port 3000 --content-base demo --inline --config demo/webpack.config.js","lint":"eslint src","test":"ava","build":"npm run build-cjs && npm run build-es6 && rimraf umd && npm run build-umd && npm run build-min","build-cjs":"rimraf lib && babel ./src -d lib","build-es6":"rimraf es6 && babel ./src -d es6 --blacklist=es6.modules","build-min":"webpack --env=production src/index.js umd/snapsheet-redux-helpers.min.js","build-umd":"webpack --env=development src/index.js umd/snapsheet-redux-helpers.js"},"_npmUser":{"name":"snapsheet","email":"tech@snapsheet.me"},"repository":{"url":"git+ssh://git@github.com/bodyshopbidsdotcom/redux-helpers.git","type":"git"},"_npmVersion":"3.10.10","description":"","directories":{},"jsnext:main":"es6/index","_nodeVersion":"6.10.2","devDependencies":{"ava":"^0.20.0","babel":"^6.23.0","jsdom":"^11.1.0","react":"^15.6.1","redux":"^3.7.1","sinon":"^2.3.6","eslint":"^4.1.1","rimraf":"^2.6.1","webpack":"^3.1.0","babel-cli":"^6.24.1","react-dom":"^15.6.1","babel-core":"^6.25.0","prop-types":"^15.5.10","browser-env":"^3.1.0","react-redux":"^5.0.5","babel-eslint":"^7.2.3","babel-loader":"^7.1.1","babel-polyfill":"^6.23.0","babel-register":"^6.24.1","redux-mock-store":"^1.2.3","babel-preset-react":"^6.24.1","webpack-dev-server":"^2.5.1","babel-preset-es2015":"^6.24.1","eslint-plugin-react":"^7.1.0","babel-preset-stage-0":"^6.24.1","eslint-config-snapsheet":"^1.0.1","babel-plugin-transform-decorators-legacy":"^1.3.4"},"peerDependencies":{"redux":"*"},"_npmOperationalInternal":{"tmp":"tmp/snapsheet-redux-helpers-1.0.0.tgz_1499450331294_0.20545111782848835","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"snapsheet-redux-helpers","version":"1.0.1","author":{"name":"Snapsheet Inc."},"license":"MIT","_id":"snapsheet-redux-helpers@1.0.1","maintainers":[{"name":"snapsheet","email":"tech@snapsheet.me"}],"homepage":"https://github.com/bodyshopbidsdotcom/redux-helpers#readme","bugs":{"url":"https://github.com/bodyshopbidsdotcom/redux-helpers/issues"},"ava":{"babel":{"babelrc":true},"files":["src/**/*.test.js"],"require":["./setupTestEnvironment.js"]},"dist":{"shasum":"711706943a6259cb8a26d17e0a526972a3d89540","tarball":"https://registry.npmjs.org/snapsheet-redux-helpers/-/snapsheet-redux-helpers-1.0.1.tgz","integrity":"sha512-2pwt05CJglLMnTcoakgkfa8KPf3zwXgjwUH0J/AX9FhwU1CDFtkkyksW4qxP7IZRkf/X8MT9xSR99P/amc74Dg==","signatures":[{"sig":"MEUCIQDCoKYLbhdTXDjHNydmpVZi+nJHgLI7j2E504UGiP+ceQIgNBoxkiWzQtyqK3GICAQhdGGjsAWG+KvX+KvcCLRwQXQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/index","_from":".","files":["*.md","es6/*","es6/*/**","lib/*","lib/*/**","umd/*","umd/*/**","src/*","src/*/**"],"_shasum":"711706943a6259cb8a26d17e0a526972a3d89540","engines":{"node":">=6.9.x","yarn":">=0.18.0"},"gitHead":"ebfa6b5bcf3af442f0abc20fa16e92eb863d8bfc","scripts":{"tdd":"ava --watch","demo":"webpack-dev-server --progress --port 3000 --content-base demo --inline --config demo/webpack.config.js","lint":"eslint src","test":"ava","build":"npm run build-cjs && npm run build-es6 && rimraf umd && npm run build-umd && npm run build-min","build-cjs":"rimraf lib && babel ./src -d lib","build-es6":"rimraf es6 && babel ./src -d es6 --blacklist=es6.modules","build-min":"webpack --env=production src/index.js umd/snapsheet-redux-helpers.min.js","build-umd":"webpack --env=development src/index.js umd/snapsheet-redux-helpers.js"},"_npmUser":{"name":"snapsheet","email":"tech@snapsheet.me"},"repository":{"url":"git+ssh://git@github.com/bodyshopbidsdotcom/redux-helpers.git","type":"git"},"_npmVersion":"3.10.10","description":"Helpers to reduce boilerplate with redux.","directories":{},"jsnext:main":"es6/index","_nodeVersion":"6.10.2","devDependencies":{"ava":"^0.20.0","babel":"^6.23.0","jsdom":"^11.1.0","react":"^15.6.1","redux":"^3.7.1","sinon":"^2.3.6","eslint":"^4.1.1","rimraf":"^2.6.1","webpack":"^3.1.0","babel-cli":"^6.24.1","react-dom":"^15.6.1","babel-core":"^6.25.0","prop-types":"^15.5.10","browser-env":"^3.1.0","react-redux":"^5.0.5","babel-eslint":"^7.2.3","babel-loader":"^7.1.1","babel-polyfill":"^6.23.0","babel-register":"^6.24.1","redux-mock-store":"^1.2.3","babel-preset-react":"^6.24.1","webpack-dev-server":"^2.5.1","babel-preset-es2015":"^6.24.1","eslint-plugin-react":"^7.1.0","babel-preset-stage-0":"^6.24.1","eslint-config-snapsheet":"^1.0.1","babel-plugin-transform-decorators-legacy":"^1.3.4"},"peerDependencies":{"redux":"*"},"_npmOperationalInternal":{"tmp":"tmp/snapsheet-redux-helpers-1.0.1.tgz_1500502882852_0.20189428911544383","host":"s3://npm-registry-packages"}}},"time":{"created":"2017-07-07T17:58:52.280Z","modified":"2026-09-24T18:59:35.738Z","1.0.0":"2017-07-07T17:58:52.280Z","1.0.1":"2017-07-19T22:21:23.845Z"},"bugs":{"url":"https://github.com/bodyshopbidsdotcom/redux-helpers/issues"},"author":{"name":"Snapsheet Inc."},"license":"MIT","homepage":"https://github.com/bodyshopbidsdotcom/redux-helpers#readme","repository":{"url":"git+ssh://git@github.com/bodyshopbidsdotcom/redux-helpers.git","type":"git"},"description":"Helpers to reduce boilerplate with redux.","maintainers":[{"email":"tech@snapsheet.me","name":"snapsheet-tech"},{"email":"snapsheetgem@snapsheet.me","name":"snapsheetgem"},{"email":"santiago@snapsheet.me","name":"santi-h"},{"email":"carl.porter@snapsheet.me","name":"carlporter"},{"email":"lionel.luchez@snapsheet.me","name":"lluchez"},{"email":"avanthi.vedire@snapsheet.me","name":"avedire"},{"email":"ifraah.beg@snapsheet.me","name":"ifraah"},{"email":"abhishek.kumar@snapsheet.me","name":"abhishek85"},{"email":"vanessa.wang@snapsheet.me","name":"vanessa.wang"},{"email":"dan.garcia@snapsheet.me","name":"garciadd"},{"email":"william.hertling@snapsheet.me","name":"williamhertling"},{"email":"manan.surti@snapsheet.me","name":"mananssh"},{"email":"nathan.harmon@snapsheet.me","name":"acting0136"},{"email":"nathan.gonzalez@snapsheet.me","name":"nathan.gonzalez"},{"email":"raphael.shejnberg@gmail.com","name":"raphaelshejnberg"},{"email":"baojhih.shao@snapsheet.me","name":"bjs93r"},{"email":"peterwlanglois@gmail.com","name":"peterwlanglois"},{"email":"deena.tenzer@snapsheet.me","name":"deenatenzer"},{"email":"rose.graner@snapsheet.me","name":"roseg"},{"email":"jonathan.versino@snapsheet.me","name":"jonathanversino-ss"},{"email":"ryan.staudt@snapsheet.me","name":"rstaudt2"},{"email":"snapsheetbot@snapsheet.me","name":"snapsheetbot"},{"email":"dan@snapsheet.me","name":"drc372"},{"email":"joyce.huang@snapsheet.me","name":"jh-snap"},{"email":"petermarathas@gmail.com","name":"petermarathas"},{"email":"eric.bluhm@snapsheet.me","name":"ericbluhm"},{"email":"greg.saunsen@snapsheet.me","name":"gsaunsen-snapsheet"},{"email":"haden.santefort@snapsheet.me","name":"haden.santefort.snapsheet"},{"email":"mike.park@snapsheet.me","name":"mpsnap"},{"email":"jacob.miller@snapsheet.me","name":"jdmsnap"},{"email":"carrie.utter@snapsheet.me","name":"uttercmsnapsheet"},{"email":"ray.olivero@snapsheet.me","name":"rayolivero"},{"email":"oren.michael.magid@gmail.com","name":"orenmagid"},{"email":"pranav.makkar@snapsheet.me","name":"pranav-snap"},{"email":"jack.wydra@snapsheet.me","name":"jwydra"},{"email":"emily.stanish@snapsheet.me","name":"emilystanish"},{"email":"ganesh.shetty@snapsheet.me","name":"gshetty007snapsheet"},{"email":"sean.inomire@gmail.com","name":"inomire"},{"email":"joe.cormier@snapsheet.me","name":"joe.cormier"},{"email":"matthieu.crepeau@snapsheet.me","name":"mcrepeau"},{"email":"yujjit.yadav@snapsheet.me","name":"yujjit"},{"email":"mitesh.shah@snapsheet.me","name":"mitesh.shah"},{"email":"kazuhiro.uchikata@snapsheet.me","name":"kazuhirouchikata"},{"email":"anva.kondakciu@snapsheet.me","name":"anvakondak"},{"email":"tyler.pospisil@snapsheet.me","name":"tpospisil_ss"},{"email":"matt@codifi.us","name":"mattheyd"},{"email":"mingming.chen@snapsheet.me","name":"doublemchen"},{"email":"nicholas.berrios@snapsheet.me","name":"nberrios-ss"},{"email":"robert.caron@snapsheet.me","name":"rcaronsnapsheet"},{"email":"appsbyanand@gmail.com","name":"anandrikka"},{"email":"michelle.pattullo@snapsheet.me","name":"mpattullo"},{"email":"rohit.jesudian@snapsheet.me","name":"rohit.jesudian"},{"email":"dustin.walker@snapsheet.me","name":"dustin-walker-snap"},{"email":"naman.mehta@snapsheet.me","name":"flipuhdelphia-work"},{"email":"wenli.jao@snapsheet.me","name":"w1inniejao"},{"email":"justin.newman@snapsheet.me","name":"justin-newman-snapsheet"},{"email":"timothy.park@snapsheet.me","name":"tpark.snapsheet"},{"email":"hayden.gray@snapsheet.me","name":"hayden.gray.snapsheet"},{"email":"esther.kalashnikova@snapsheet.me","name":"essieka"},{"email":"james.garner@snapsheet.me","name":"jamesgarner-ss"},{"email":"marco.aleman@snapsheet.me","name":"marco.aleman"},{"email":"paikattilrohin@gmail.com","name":"brohin"},{"email":"sergey.latkin@snapsheet.me","name":"sergey.latkin"},{"email":"luke.myers1014@gmail.com","name":"luke-myers101493"},{"email":"priyanklalitkant.kapadia@snapsheet.me","name":"priyanklalitkantkapadia-snapsheet"},{"email":"ann.trachte@snapsheet.me","name":"atrasnap"},{"email":"jarrod.chung@snapsheet.me","name":"jarrod-chung-snapsheet"},{"email":"kevin.stubblefield@snapsheet.me","name":"kevin-stubblefield"},{"email":"alex.tan@snapsheet.me","name":"alextan-snapsheet"},{"email":"nathanael.jackson@snapsheet.me","name":"nate-jackson-snapsheet"},{"email":"nachiket.joshi@snapsheet.me","name":"njoshi-snapsheet"},{"email":"tyler.benton@snapsheet.me","name":"tylerbenton-snapsheet"},{"email":"jeremy.trujillo@snapsheet.me","name":"jeremytru"},{"email":"jeff.schmitz@snapsheet.me","name":"iamtheschmitzer"},{"email":"dominic.hupp@snapsheet.me","name":"dh-snapsheet"},{"email":"hitesh.kumar@snapsheet.me","name":"hkumar123"},{"email":"aunss.gheyouche@gmail.com","name":"aunssg"},{"email":"katie.phillips@snapsheet.me","name":"katiephillips-snap"},{"email":"steven.joseph@snapsheet.me","name":"sj-snap"},{"email":"andrew.santos@snapsheet.me","name":"asantos649"},{"email":"carl.laviolette@snapsheet.me","name":"claviolette"},{"email":"michael.stieber@snapsheet.me","name":"mikes_snap2026"},{"email":"jeremy.fountaine@snapsheet.me","name":"jeremyfountaine"},{"email":"kenta.goto@snapsheet.me","name":"kgoto-snap"},{"email":"brandon.coleman@snapsheet.me","name":"bcsnaps"},{"email":"adam.tenderholt@snapsheet.me","name":"atenderholt-snapsheet"},{"email":"adriano.santosfilho@snapsheet.me","name":"asant-os"},{"email":"Justice.Agbonma@snapsheet.me","name":"justiceagbonma"},{"email":"hunter.ross@snapsheet.me","name":"hunter.ross"},{"email":"steven.chavez@snapsheet.me","name":"steven-chavez-572"},{"email":"hoda.nasser@snapsheet.me","name":"hodanasser"},{"email":"morgan.showman@snapsheet.me","name":"morgan.showman.snsh"},{"email":"adam.byer@snapsheet.me","name":"adambyersnapsheet"},{"email":"benito.juarez@snapsheet.me","name":"benito.juarez"},{"email":"nicholas.watkins@snapsheet.me","name":"nicholas.watkins"},{"email":"daniel.skrei@snapsheet.me","name":"dskrei-snapsheet"},{"email":"andrew.hamacher@snapsheet.me","name":"amhamacher"},{"email":"nathaniel.cabrera@snapsheet.me","name":"nate.cabrera.snapsheet"},{"email":"leonard.lozovsky@snapsheet.me","name":"lenny-snapsheet"},{"email":"kyle.bryant@snapsheet.me","name":"snap_worker8"},{"email":"kevin.okinedo@snapsheet.me","name":"kokinedo-snapsheet"},{"email":"jessica.kress@snapsheet.me","name":"jessica.kress"},{"email":"kumar.abrol@snapsheet.me","name":"kumarabrol"},{"email":"jenni.chng@snapsheet.me","name":"jennisnapsheet"},{"email":"abbi.johnson@snapsheet.me","name":"ajsnapsheet"},{"email":"kyle.pacheco@snapsheet.me","name":"kylepacheco-snapsheet"},{"email":"ryan.mark@snapsheet.me","name":"ryanmarksnapsheet"},{"email":"jsainz237+dev@gmail.com","name":"jsainz237"},{"email":"charles.hellstrom@snapsheet.me","name":"chellstrom-snapsheet"},{"email":"alvitovitch@gmail.com","name":"alvitovitch"},{"email":"anthony.dsouza@snapsheet.me","name":"adsouza-snapsheet"},{"email":"jessica.kohl@snapsheet.me","name":"kohljd"},{"email":"daniel.marc.gardner@gmail.com","name":"danielmarcgardner"},{"email":"benjamin.borges@snapsheet.me","name":"benbo99"},{"email":"jeffrey.hage@snapsheet.me","name":"jhage-snapsheet"},{"email":"nicholas@nicholasreynolds.com","name":"nicholasjreynolds"},{"email":"benjamin.mesirow@snapsheet.me","name":"ben-mesirow-snapsheet"},{"email":"james.ganzer@snapsheet.me","name":"jganzer"},{"email":"andrew.mansavage@snapsheet.me","name":"andy-man"},{"email":"thomas.zhang@snapsheet.me","name":"tfzhang-snapsheet"},{"email":"fernando.paniagua@snapsheet.me","name":"fpaniagua-snapsheet"},{"email":"jadarius.hill@snapsheet.me","name":"jadabyte256"},{"email":"trevor.bagbey@snapsheet.me","name":"tbagbey"},{"email":"brandon.campbell@snapsheet.me","name":"bcampbell-snap"}],"readme":"# snapsheet-redux-helpers\n\nHelpers to reduce boilerplate with redux.\n\n[![npm version](https://img.shields.io/npm/v/snapsheet-redux-helpers.svg?style=flat-square)](https://www.npmjs.com/package/snapsheet-redux-helpers)\n[![npm downloads](https://img.shields.io/npm/dm/snapsheet-redux-helpers.svg?style=flat-square)](https://www.npmjs.com/package/snapsheet-redux-helpers)\n[![Build Status](https://travis-ci.org/bodyshopbidsdotcom/redux-helpers.svg?branch=master)](https://travis-ci.org/bodyshopbidsdotcom/redux-helpers)\n\n## Installation\n\n    $ npm install snapsheet-redux-helpers --save\n\n  or with yarn\n\n    $ yarn add snapsheet-redux-helpers\n\n## Api middleware\nUsing the api middleware reduces boilerplate for async actions. Instead of writing actions for your apis like this:\n\n```javascript\nexport function login(username, password) {\n  return (dispatch, getState) => {\n    dispatch({ type: 'LOGIN' });\n    return postJSON('/api/v1/login', { username, password }).then(\n      (data) => {\n        dispatch({ type: 'LOGIN_SUCCESS', result: data });\n        return data;\n      },\n      (error) => {\n        // handle error\n        dispatch({ type: 'LOGIN_ERROR', error: error })\n        return Promise.reject(error);\n      }\n    );\n  }\n}\n```\n\nYou can write them like this with the use of AjaxAction:\n\n```javascript\nexport function login(username, password) {\n  return new AjaxAction('LOGIN')\n    .call((apiClient) => apiClient.postJSON('/api/v1/login', { username, password }))\n    .toReduxAction();\n}\n```\n\n### Setting up api middleware\n```javascript\nimport { createApiMiddleware } from 'snapsheet-redux-helpers';\n```\n\nYou can also minimize the bundle by importing only the files you need\n\n```javascript\nimport createApiMiddleware from 'snapsheet-redux-helpers/lib/createApiMiddleware';\n```\n\n\n```javascript\nconst middleware = [\n  createApiMiddleware(ApiClient)\n];\n\nconst store = createStore(rootReducer, composeEnhancers(\n  applyMiddleware(...middleware)\n));\n```\n\n**NOTE**: you will need an ApiClient model to use. See [SampleApiClient](https://github.com/bodyshopbidsdotcom/redux-helpers/blob/master/demo/SampleApiClient.js) for\nan example of how it could be setup. It should accept `dispatch, getState` in the constructor, but the rest is up to you! This allows you to generalize what happens whenever an ajax call is made, such as beginning a loading indicator,\ndisplaying flash messages when an error occurs, or automatically adding params to requests. It also\ngives you the freedom to use other libraries to make your requests. The only limitation is that each\naction should return a `Promise`.\n\nSee [demo/index.js](https://github.com/bodyshopbidsdotcom/redux-helpers/blob/master/demo/index.js) for more example usage.\n\n## Demo\n\n    $ git clone https://github.com/bodyshopbidsdotcom/redux-helpers.git\n    $ cd redux-helpers\n    $ npm install\n    $ npm run demo\n    $ open http://localhost:3000\n\n## Contributing\nPlease create an issue with any feature suggestions or bug reports. Pull requests are welcome.\n","readmeFilename":"README.md"}