New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

redux-arc

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-arc - npm Package Compare versions

Comparing version 0.4.1 to 0.4.2

6

dist/redux.js

@@ -259,3 +259,7 @@ (function (global, factory) {

return function (action) {
store.dispatch({ type: requestType, meta: action.meta });
store.dispatch({
type: requestType,
meta: action.meta,
payload: action.payload
});

@@ -262,0 +266,0 @@ var done = function done(err, response) {

2

dist/redux.min.js

@@ -1,1 +0,1 @@

!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("redux")):"function"==typeof define&&define.amd?define(["exports","redux"],e):e(r.ReduxArc=r.ReduxArc||{},r.Redux)}(this,function(r,e){"use strict";function t(r,e){var t={};for(var n in r)0>e.indexOf(n)&&Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n]);return t}function n(r,e){return"function"==typeof e.modifier?e.modifier(r):r}function o(r){r.forEach(function(r){if(!g[r])throw Error("Request Middleware "+r+" not registered. Perhaps you forgot to import its file")})}function a(r){return Array.isArray(r)?(o(r),b(r)):b([])}function i(r,e){var t={};for(var n in r)0>e.indexOf(n)&&Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n]);return t}function u(r,e,t){function o(t){var o=n(t,r)||{},a=o.payload,u=i(o,["payload"]),f="function"==typeof r.url?r.url(u):r.url,p={type:[e.REQUEST,e.RESPONSE],meta:O({},u,{url:c(f,u),method:r.method})};return a&&(p.payload=a),r.meta&&(p.meta=O({},r.meta,p.meta)),r.middlewares&&(p.meta.middlewares=r.middlewares),p}return Object.defineProperty(o,"name",{value:t+"_"+e.uppercaseName+" apiCreator",writable:!1}),o}function c(r,e){return r.replace(/(:)([A-Za-z0-9]*)/g,function(t,n,o){var a=typeof e[o];if("string"!==a&&"number"!==a)throw Error("Param "+o+" from url "+r+", not found in params object");return e[o]})}function f(r,e){if(Object.keys(e).forEach(function(t){var n=e[t],o=r+"_"+l(t);if("string"!=typeof n.url&&"function"!=typeof n.url)throw Error("Invalid url, "+n.url+", provided for "+o+", it should be a string or a function that returns a string");if("string"==typeof n.url&&/:payload*/g.test(n.url))throw Error("Invalid url, "+n.url+", provided for "+o+", you cannot use payload as a param");if("string"!=typeof n.method||!n.method.length)throw Error("Invalid method, "+n.method+", provided for "+o+", it should be a string");if(n.modifier&&"function"!=typeof n.modifier)throw Error("Invalid modifier handler, "+n.modifier+", provided for "+o+", it should be a function")}),!r||"string"!=typeof r)throw Error("Invalid namespace provided: "+r+", it should be a string")}function p(r,e){return function(t){return function(n){return function(o){t.dispatch({type:r,meta:o.meta});var a=R({payload:o.payload},o.meta);return e(t)(function(r,e){return n(o,r,e)})(a)}}}}function s(r){return function(e){return function(t,n,o){var a={type:r,meta:t.meta,payload:o};if(n){var i=R({},a,{error:!0,payload:n});return e.dispatch(i),n}return e.dispatch(a),o}}}var d=Object.assign||function(r){for(var e=1;arguments.length>e;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},l=function(r){return r.replace(/([A-Z])/g,"_$1").toUpperCase()},y=function(r,e){return r.reduce(function(r,t){var n,o=l(t);return d({},r,(n={},n[t]={uppercaseName:o,REQUEST:e+"_"+o+"_REQUEST",RESPONSE:e+"_"+o+"_RESPONSE"},n))},{})},m=function(r,e,t,n){return Object.keys(r).reduce(function(o,a){var i;return d({},o,(i={},i[a]=n(r[a],e[a],t),i))},{})},v=function(r){return Object.keys(r).reduce(function(e,n){var o,a=r[n],i=a.uppercaseName,u=t(a,["uppercaseName"]);return d({},e,(o={},o[i]=u,o))},{})},h={parseToUppercase:l,createTypes:y,parseOptions:n,createCreators:m,reduceActionTypes:v},w=["onRequest","onResponse"],g={},b=function(r){return function(t){var n=r.map(function(r){return g[r]}).filter(function(r){return r.applyPoint===t});return function(r){return function(t){var o=n.map(function(e){return e(r)});return e.compose.apply(void 0,o)(t)}}}},E={globalMiddlewares:g,register:function(r,e){var t;if(g[r])throw Error("Called register with middleware: "+r+" more than once");if(0>w.indexOf(e.applyPoint)){var n="Invalid applyPoint: "+e.applyPoint+", provided with middleware: "+r+".",o="The apply points available are: "+w.join(", ");throw Error(n+" "+o)}Object.assign(g,(t={},t[r]=e,t))},getRequestMiddlewares:a,reset:function(){Object.keys(g).forEach(function(r){delete g[r]})}},O=Object.assign||function(r){for(var e=1;arguments.length>e;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},j=function(r){return"string"==typeof r},P=function(r){return 2===r.length&&r.every(j)},R=Object.assign||function(r){for(var e=1;arguments.length>e;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r};r.asyncActionHelpers=h,r.middlewares=E,r.createApiActions=function(r,e,t){var n=l(r);f(n,e);var o=Object.keys(e),a=y(o,n);return{creators:m(e,a,n,u),types:v(a)}},r.createAsyncMiddleware=function(r){if("function"!=typeof r)throw Error("You must provide a asyncTask function to createAsyncMiddleware, with the following signature: \n done => (action, error, response) => done(action, error, response)");return function(t){return function(n){return function(o){var i=o.type,u=o.meta;if(!Array.isArray(i))return n(o);if(!P(i))throw Error("Expected type to be an array of two strings, request and response.");if(!u||"object"!=typeof u)throw Error("Expected meta to be an object");var c=a(o.meta.middlewares),f=o.type,d=f[0],l=f[1],y=[c("onRequest"),p(d,r),c("onResponse")].map(function(r){return r(t)}),m=s(l)(t);return e.compose.apply(void 0,y)(m)(o)}}}},Object.defineProperty(r,"__esModule",{value:!0})});
!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("redux")):"function"==typeof define&&define.amd?define(["exports","redux"],e):e(r.ReduxArc=r.ReduxArc||{},r.Redux)}(this,function(r,e){"use strict";function t(r,e){var t={};for(var n in r)0>e.indexOf(n)&&Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n]);return t}function n(r,e){return"function"==typeof e.modifier?e.modifier(r):r}function o(r){r.forEach(function(r){if(!g[r])throw Error("Request Middleware "+r+" not registered. Perhaps you forgot to import its file")})}function a(r){return Array.isArray(r)?(o(r),b(r)):b([])}function i(r,e){var t={};for(var n in r)0>e.indexOf(n)&&Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n]);return t}function u(r,e,t){function o(t){var o=n(t,r)||{},a=o.payload,u=i(o,["payload"]),f="function"==typeof r.url?r.url(u):r.url,p={type:[e.REQUEST,e.RESPONSE],meta:O({},u,{url:c(f,u),method:r.method})};return a&&(p.payload=a),r.meta&&(p.meta=O({},r.meta,p.meta)),r.middlewares&&(p.meta.middlewares=r.middlewares),p}return Object.defineProperty(o,"name",{value:t+"_"+e.uppercaseName+" apiCreator",writable:!1}),o}function c(r,e){return r.replace(/(:)([A-Za-z0-9]*)/g,function(t,n,o){var a=typeof e[o];if("string"!==a&&"number"!==a)throw Error("Param "+o+" from url "+r+", not found in params object");return e[o]})}function f(r,e){if(Object.keys(e).forEach(function(t){var n=e[t],o=r+"_"+l(t);if("string"!=typeof n.url&&"function"!=typeof n.url)throw Error("Invalid url, "+n.url+", provided for "+o+", it should be a string or a function that returns a string");if("string"==typeof n.url&&/:payload*/g.test(n.url))throw Error("Invalid url, "+n.url+", provided for "+o+", you cannot use payload as a param");if("string"!=typeof n.method||!n.method.length)throw Error("Invalid method, "+n.method+", provided for "+o+", it should be a string");if(n.modifier&&"function"!=typeof n.modifier)throw Error("Invalid modifier handler, "+n.modifier+", provided for "+o+", it should be a function")}),!r||"string"!=typeof r)throw Error("Invalid namespace provided: "+r+", it should be a string")}function p(r,e){return function(t){return function(n){return function(o){t.dispatch({type:r,meta:o.meta,payload:o.payload});var a=R({payload:o.payload},o.meta);return e(t)(function(r,e){return n(o,r,e)})(a)}}}}function d(r){return function(e){return function(t,n,o){var a={type:r,meta:t.meta,payload:o};if(n){var i=R({},a,{error:!0,payload:n});return e.dispatch(i),n}return e.dispatch(a),o}}}var s=Object.assign||function(r){for(var e=1;arguments.length>e;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},l=function(r){return r.replace(/([A-Z])/g,"_$1").toUpperCase()},y=function(r,e){return r.reduce(function(r,t){var n,o=l(t);return s({},r,(n={},n[t]={uppercaseName:o,REQUEST:e+"_"+o+"_REQUEST",RESPONSE:e+"_"+o+"_RESPONSE"},n))},{})},m=function(r,e,t,n){return Object.keys(r).reduce(function(o,a){var i;return s({},o,(i={},i[a]=n(r[a],e[a],t),i))},{})},v=function(r){return Object.keys(r).reduce(function(e,n){var o,a=r[n],i=a.uppercaseName,u=t(a,["uppercaseName"]);return s({},e,(o={},o[i]=u,o))},{})},h={parseToUppercase:l,createTypes:y,parseOptions:n,createCreators:m,reduceActionTypes:v},w=["onRequest","onResponse"],g={},b=function(r){return function(t){var n=r.map(function(r){return g[r]}).filter(function(r){return r.applyPoint===t});return function(r){return function(t){var o=n.map(function(e){return e(r)});return e.compose.apply(void 0,o)(t)}}}},E={globalMiddlewares:g,register:function(r,e){var t;if(g[r])throw Error("Called register with middleware: "+r+" more than once");if(0>w.indexOf(e.applyPoint)){var n="Invalid applyPoint: "+e.applyPoint+", provided with middleware: "+r+".",o="The apply points available are: "+w.join(", ");throw Error(n+" "+o)}Object.assign(g,(t={},t[r]=e,t))},getRequestMiddlewares:a,reset:function(){Object.keys(g).forEach(function(r){delete g[r]})}},O=Object.assign||function(r){for(var e=1;arguments.length>e;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},j=function(r){return"string"==typeof r},P=function(r){return 2===r.length&&r.every(j)},R=Object.assign||function(r){for(var e=1;arguments.length>e;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r};r.asyncActionHelpers=h,r.middlewares=E,r.createApiActions=function(r,e,t){var n=l(r);f(n,e);var o=Object.keys(e),a=y(o,n);return{creators:m(e,a,n,u),types:v(a)}},r.createAsyncMiddleware=function(r){if("function"!=typeof r)throw Error("You must provide a asyncTask function to createAsyncMiddleware, with the following signature: \n done => (action, error, response) => done(action, error, response)");return function(t){return function(n){return function(o){var i=o.type,u=o.meta;if(!Array.isArray(i))return n(o);if(!P(i))throw Error("Expected type to be an array of two strings, request and response.");if(!u||"object"!=typeof u)throw Error("Expected meta to be an object");var c=a(o.meta.middlewares),f=o.type,s=f[0],l=f[1],y=[c("onRequest"),p(s,r),c("onResponse")].map(function(r){return r(t)}),m=d(l)(t);return e.compose.apply(void 0,y)(m)(o)}}}},Object.defineProperty(r,"__esModule",{value:!0})});

@@ -35,3 +35,7 @@ 'use strict';

return function (action) {
store.dispatch({ type: requestType, meta: action.meta });
store.dispatch({
type: requestType,
meta: action.meta,
payload: action.payload
});

@@ -38,0 +42,0 @@ var done = function done(err, response) {

{
"name": "redux-arc",
"version": "0.4.1",
"version": "0.4.2",
"description": "Abstraction layer to simplify rest api calls in redux",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -23,3 +23,7 @@ import { checkAction } from './helpers';

return store => next => (action) => {
store.dispatch({ type: requestType, meta: action.meta });
store.dispatch({
type: requestType,
meta: action.meta,
payload: action.payload,
});

@@ -26,0 +30,0 @@ const done = (err, response) => next(action, err, response);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc