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

next-redux-saga

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-redux-saga - npm Package Compare versions

Comparing version 3.0.0-beta.1 to 3.0.0-beta.2

169

dist/next-redux-saga.es.js

@@ -1,20 +0,137 @@

import _regeneratorRuntime from 'babel-runtime/regenerator';
import _regeneratorRuntime from '@babel/runtime/regenerator';
import React, { Component } from 'react';
import { END } from 'redux-saga';
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function step(key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _next(value) {
step("next", value);
}
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _throw(err) {
step("throw", err);
}
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
_next();
});
};
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
var ownKeys = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === 'function') {
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
}));
}
ownKeys.forEach(function (key) {
_defineProperty(target, key, source[key]);
});
}
return target;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
_setPrototypeOf(subClass.prototype, superClass && superClass.prototype);
if (superClass) _setPrototypeOf(subClass, superClass);
}
function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _setPrototypeOf(o, p);
}
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
function _possibleConstructorReturn(self, call) {
if (call && (typeof call === "object" || typeof call === "function")) {
return call;
}
return _assertThisInitialized(self);
}
function hoc(config) {
return function (BaseComponent) {
var WrappedComponent = function (_Component) {
var WrappedComponent =
/*#__PURE__*/
function (_Component) {
_inherits(WrappedComponent, _Component);

@@ -29,3 +146,3 @@

_createClass(WrappedComponent, [{
key: 'render',
key: "render",
value: function render() {

@@ -35,5 +152,7 @@ return React.createElement(BaseComponent, this.props);

}], [{
key: 'getInitialProps',
key: "getInitialProps",
value: function () {
var _ref = _asyncToGenerator(_regeneratorRuntime.mark(function _callee(props) {
var _getInitialProps = _asyncToGenerator(
/*#__PURE__*/
_regeneratorRuntime.mark(function _callee(props) {
var _props$ctx, isServer, store, pageProps;

@@ -65,6 +184,5 @@

return _context.abrupt('return', pageProps);
return _context.abrupt("return", pageProps);
case 8:
// Force saga to end in all other cases

@@ -76,3 +194,2 @@ store.dispatch(END);

case 11:
// Restart saga on the client (sync mode)

@@ -83,6 +200,6 @@ if (!isServer) {

return _context.abrupt('return', pageProps);
return _context.abrupt("return", pageProps);
case 13:
case 'end':
case "end":
return _context.stop();

@@ -94,7 +211,5 @@ }

function getInitialProps(_x) {
return _ref.apply(this, arguments);
}
return getInitialProps;
return function getInitialProps(_x) {
return _getInitialProps.apply(this, arguments);
};
}()

@@ -106,2 +221,8 @@ }]);

Object.defineProperty(WrappedComponent, "displayName", {
configurable: true,
enumerable: true,
writable: true,
value: "withReduxSaga(".concat(BaseComponent.displayName || BaseComponent.name || 'BaseComponent', ")")
});
return WrappedComponent;

@@ -112,3 +233,5 @@ };

function withReduxSaga(arg) {
var defaultConfig = { async: false };
var defaultConfig = {
async: false
};

@@ -119,3 +242,3 @@ if (typeof arg === 'function') {

return hoc(_extends({}, defaultConfig, arg));
return hoc(_objectSpread({}, defaultConfig, arg));
}

@@ -122,0 +245,0 @@

289

dist/next-redux-saga.umd.js
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('babel-runtime/regenerator'), require('react'), require('redux-saga')) :
typeof define === 'function' && define.amd ? define(['babel-runtime/regenerator', 'react', 'redux-saga'], factory) :
(global['next-redux-saga'] = factory(global.regeneratorRuntime,global.React,global.ReduxSaga));
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@babel/runtime/regenerator'), require('react'), require('redux-saga')) :
typeof define === 'function' && define.amd ? define(['@babel/runtime/regenerator', 'react', 'redux-saga'], factory) :
(global['next-redux-saga'] = factory(null,global.React,global.ReduxSaga));
}(this, (function (_regeneratorRuntime,React,reduxSaga) { 'use strict';
_regeneratorRuntime = _regeneratorRuntime && _regeneratorRuntime.hasOwnProperty('default') ? _regeneratorRuntime['default'] : _regeneratorRuntime;
var React__default = 'default' in React ? React['default'] : React;
_regeneratorRuntime = _regeneratorRuntime && _regeneratorRuntime.hasOwnProperty('default') ? _regeneratorRuntime['default'] : _regeneratorRuntime;
var React__default = 'default' in React ? React['default'] : React;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function step(key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _next(value) {
step("next", value);
}
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _throw(err) {
step("throw", err);
}
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
_next();
});
};
}
function hoc(config) {
return function (BaseComponent) {
var WrappedComponent = function (_Component) {
_inherits(WrappedComponent, _Component);
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function WrappedComponent() {
_classCallCheck(this, WrappedComponent);
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return _possibleConstructorReturn(this, (WrappedComponent.__proto__ || Object.getPrototypeOf(WrappedComponent)).apply(this, arguments));
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
var ownKeys = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === 'function') {
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
}));
}
_createClass(WrappedComponent, [{
key: 'render',
value: function render() {
return React__default.createElement(BaseComponent, this.props);
}
}], [{
key: 'getInitialProps',
value: function () {
var _ref = _asyncToGenerator(_regeneratorRuntime.mark(function _callee(props) {
var _props$ctx, isServer, store, pageProps;
ownKeys.forEach(function (key) {
_defineProperty(target, key, source[key]);
});
}
return _regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_props$ctx = props.ctx, isServer = _props$ctx.isServer, store = _props$ctx.store;
pageProps = {};
return target;
}
if (!BaseComponent.getInitialProps) {
_context.next = 6;
break;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
_context.next = 5;
return BaseComponent.getInitialProps(props);
_setPrototypeOf(subClass.prototype, superClass && superClass.prototype);
case 5:
pageProps = _context.sent;
if (superClass) _setPrototypeOf(subClass, superClass);
}
case 6:
if (!(config.async && !isServer)) {
_context.next = 8;
break;
}
function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _context.abrupt('return', pageProps);
return _setPrototypeOf(o, p);
}
case 8:
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
// Force saga to end in all other cases
store.dispatch(reduxSaga.END);
_context.next = 11;
return store.sagaTask.done;
return self;
}
case 11:
function _possibleConstructorReturn(self, call) {
if (call && (typeof call === "object" || typeof call === "function")) {
return call;
}
// Restart saga on the client (sync mode)
if (!isServer) {
store.runSagaTask();
}
return _assertThisInitialized(self);
}
return _context.abrupt('return', pageProps);
function hoc(config) {
return function (BaseComponent) {
var WrappedComponent =
/*#__PURE__*/
function (_Component) {
_inherits(WrappedComponent, _Component);
case 13:
case 'end':
return _context.stop();
}
}
}, _callee, this);
}));
function WrappedComponent() {
_classCallCheck(this, WrappedComponent);
function getInitialProps(_x) {
return _ref.apply(this, arguments);
return _possibleConstructorReturn(this, (WrappedComponent.__proto__ || Object.getPrototypeOf(WrappedComponent)).apply(this, arguments));
}
_createClass(WrappedComponent, [{
key: "render",
value: function render() {
return React__default.createElement(BaseComponent, this.props);
}
}], [{
key: "getInitialProps",
value: function () {
var _getInitialProps = _asyncToGenerator(
/*#__PURE__*/
_regeneratorRuntime.mark(function _callee(props) {
var _props$ctx, isServer, store, pageProps;
return getInitialProps;
}()
}]);
return _regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_props$ctx = props.ctx, isServer = _props$ctx.isServer, store = _props$ctx.store;
pageProps = {};
if (!BaseComponent.getInitialProps) {
_context.next = 6;
break;
}
_context.next = 5;
return BaseComponent.getInitialProps(props);
case 5:
pageProps = _context.sent;
case 6:
if (!(config.async && !isServer)) {
_context.next = 8;
break;
}
return _context.abrupt("return", pageProps);
case 8:
// Force saga to end in all other cases
store.dispatch(reduxSaga.END);
_context.next = 11;
return store.sagaTask.done;
case 11:
// Restart saga on the client (sync mode)
if (!isServer) {
store.runSagaTask();
}
return _context.abrupt("return", pageProps);
case 13:
case "end":
return _context.stop();
}
}
}, _callee, this);
}));
return function getInitialProps(_x) {
return _getInitialProps.apply(this, arguments);
};
}()
}]);
return WrappedComponent;
}(React.Component);
Object.defineProperty(WrappedComponent, "displayName", {
configurable: true,
enumerable: true,
writable: true,
value: "withReduxSaga(".concat(BaseComponent.displayName || BaseComponent.name || 'BaseComponent', ")")
});
return WrappedComponent;
}(React.Component);
};
}
return WrappedComponent;
};
}
function withReduxSaga(arg) {
var defaultConfig = {
async: false
};
function withReduxSaga(arg) {
var defaultConfig = { async: false };
if (typeof arg === 'function') {
return hoc(defaultConfig)(arg);
}
if (typeof arg === 'function') {
return hoc(defaultConfig)(arg);
return hoc(_objectSpread({}, defaultConfig, arg));
}
return hoc(_extends({}, defaultConfig, arg));
}
return withReduxSaga;
return withReduxSaga;
})));
//# sourceMappingURL=next-redux-saga.umd.js.map
{
"name": "next-redux-saga",
"version": "3.0.0-beta.1",
"version": "3.0.0-beta.2",
"description": "redux-saga HOC for Next.js",

@@ -42,2 +42,10 @@ "repository": "https://github.com/bmealhouse/next-redux-saga.git",

},
"renovate": {
"automerge": true,
"automergeType": "branch-push",
"pinVersions": true,
"schedule": [
"every friday"
]
},
"xo": {

@@ -60,32 +68,30 @@ "envs": [

"devDependencies": {
"babel-core": "6.26.0",
"babel-eslint": "8.0.2",
"babel-jest": "22.1.0",
"babel-plugin-transform-runtime": "6.23.0",
"babel-preset-env": "1.6.1",
"babel-preset-react": "6.24.1",
"babel-preset-stage-3": "6.24.1",
"@babel/core": "7.0.0-beta.46",
"@babel/runtime": "7.0.0-beta.46",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "8.2.3",
"babel-jest": "22.4.3",
"enzyme": "3.3.0",
"enzyme-adapter-react-16": "1.1.1",
"enzyme-to-json": "3.3.1",
"eslint": "3.19.0",
"enzyme-to-json": "3.3.3",
"eslint": "4.19.1",
"eslint-config-prettier": "2.9.0",
"eslint-plugin-react": "7.6.1",
"eslint-plugin-react": "7.8.1",
"husky": "0.14.3",
"jest": "22.1.4",
"lint-staged": "6.1.0",
"next": "6.0.0",
"next-redux-wrapper": "2.0.0-beta.4",
"prettier": "1.10.2",
"prop-types": "15.6.0",
"react": "16.2.0",
"react-dom": "16.2.0",
"react-redux": "5.0.6",
"react-test-renderer": "16.2.0",
"redux": "3.7.2",
"jest": "22.4.3",
"lint-staged": "7.1.0",
"next": "6.0.1",
"next-redux-wrapper": "2.0.0-beta.6",
"prettier": "1.12.1",
"prop-types": "15.6.1",
"react": "16.3.2",
"react-dom": "16.3.2",
"react-redux": "5.0.7",
"react-test-renderer": "16.3.2",
"redux": "4.0.0",
"redux-saga": "0.16.0",
"release": "3.1.5",
"rollup": "0.55.1",
"rollup-plugin-babel": "3.0.3",
"xo": "0.18.2"
"release": "4.0.0",
"rollup": "0.58.2",
"rollup-plugin-babel": "4.0.0-beta.4",
"xo": "0.21.0"
},

@@ -92,0 +98,0 @@ "bugs": {

@@ -9,4 +9,2 @@ # next-redux-saga

:warning: This will work only with NextJS 6+ :warning:
## Installation

@@ -18,2 +16,8 @@

> Note: If you are using Next.js 6+ you have to install `next-redux-saga` with
>
> ```js
> yarn add next-redux-saga@beta
> ```
## Getting Started

@@ -75,6 +79,6 @@

import React from 'react'
import {Provider} from 'react-redux'
import App, {Container} from 'next/app'
import {Provider} from 'react-redux'
import withRedux from 'next-redux-wrapper'
import nextReduxSaga from 'next-redux-saga'
import withReduxSaga from 'next-redux-saga'
import configureStore from './configure-store'

@@ -81,0 +85,0 @@

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