Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

redux-saga-resources

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-saga-resources - npm Package Compare versions

Comparing version 0.1.7 to 0.1.10

2

es6/batch/interfaces.d.ts

@@ -46,3 +46,3 @@ import { EmptyActionCreator, ActionCreator } from 'redux-typescript-actions';

item(state: any): T;
sourceItems(state: any): T;
sourceItems(state: any): T[];
}

@@ -49,0 +49,0 @@ export interface IBatchMerger<T> {

@@ -6,4 +6,4 @@ export default function selectors<T>(name: any, options: any, resource: any): {

deleting: (state: any) => any;
sourceItems: (state: any) => T;
sourceItems: (state: any) => T[];
item: (state: any) => T;
};

@@ -179,2 +179,13 @@ "use strict";

exports.restMiddleware = restMiddleware;
function* safeFetch(url, options) {
try {
return yield effects_1.call(() => fetch(url, options));
}
catch (ex) {
return {
statusText: 'error',
statusCode: 0
};
}
}
function* fetchMiddleware({ request, response, withResponse }, next) {

@@ -185,3 +196,3 @@ const paramKeys = Object.keys(request.params);

const url = params ? `${baseUrl}?${params}` : baseUrl;
const result = yield effects_1.call(() => fetch(url, {
const result = yield safeFetch(url, {
method: request.method,

@@ -191,3 +202,3 @@ headers: request.headers,

body: request.body
}));
});
response.statusText = result.statusText;

@@ -194,0 +205,0 @@ response.statusCode = result.status;

{
"name": "redux-saga-resources",
"version": "0.1.7",
"version": "0.1.10",
"description": "",

@@ -5,0 +5,0 @@ "typings": "es6/index.d.ts",

@@ -34,3 +34,3 @@ import actionCreatorFactory, { EmptyActionCreator, ActionCreator } from 'redux-typescript-actions';

item(state): T;
sourceItems(state): T;
sourceItems(state): T[];
}

@@ -37,0 +37,0 @@ export interface IBatchMerger<T> {

@@ -15,5 +15,5 @@ import { internal } from '../utils/internal';

deleting: (state) => scope(state).deleting,
sourceItems: (state): T => scope(state).items,
sourceItems: (state): T[] => scope(state).items,
item: (state): T => scope(state).item
}
}

@@ -198,2 +198,12 @@ import * as fetch from 'isomorphic-fetch';

}
function* safeFetch(url, options) {
try {
return yield call(() => fetch(url, options)) as any;
} catch(ex) {
return {
statusText: 'error',
statusCode: 0
};
}
}
export function* fetchMiddleware({ request, response, withResponse }, next) {

@@ -205,3 +215,3 @@ const paramKeys = Object.keys(request.params);

const result = yield call(() => fetch(url, {
const result = yield safeFetch(url, {
method: request.method,

@@ -211,3 +221,3 @@ headers: request.headers,

body: request.body
})) as any;
}) as any;

@@ -214,0 +224,0 @@ response.statusText = result.statusText;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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