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

redux-supermodel

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-supermodel - npm Package Compare versions

Comparing version 0.18.0 to 0.18.1

21

dist/reducer.js

@@ -7,2 +7,4 @@ 'use strict';

var _handlers;
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; };

@@ -116,2 +118,4 @@

var handlers = (_handlers = {}, _defineProperty(_handlers, types.RESET, reset), _defineProperty(_handlers, types.PENDING, pending), _defineProperty(_handlers, types.FULFILLED, fulfilled), _defineProperty(_handlers, types.REJECTED, rejected), _defineProperty(_handlers, types.CLEAR_ERRORS, clearErrors), _handlers);
function reducer() {

@@ -129,16 +133,7 @@ var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;

switch (type) {
case types.RESET:
return reset(state, action);
case types.PENDING:
return pending(state, action);
case types.FULFILLED:
return fulfilled(state, action);
case types.REJECTED:
return rejected(state, action);
case types.CLEAR_ERRORS:
return clearErrors(state, action);
default:
throw new Error('Unrecognized action type: ' + type);
if (handlers[type]) {
return handlers[type](state, action);
} else {
throw new Error('Unrecognized action type: ' + type);
}
}
{
"name": "redux-supermodel",
"version": "0.18.0",
"version": "0.18.1",
"description": "A package of action creator functions and reducers that deal with the state management of REST-like APIs for you... all you need is a URL!",

@@ -5,0 +5,0 @@ "repository": "https://github.com/MrLeebo/redux-supermodel",

@@ -52,2 +52,3 @@ # redux-supermodel

export const post = client('post', { url: 'posts/latest' })
post.fetch()
```

@@ -79,10 +80,8 @@

componentWillUnmount() {
// If you only ever access a resource within the context of a single component and
// its children, you can reset the resource on unmount to clean up your redux state.
this.props.resetPost()
}
// If you only ever access a resource within the context of a single component and
// its children, you can reset the resource on unmount to clean up your redux state.
componentWillUnmount = () => this.props.resetPost()
render() {
const { initialized, error, title, body, fetchPost } = props
const { initialized, error, title, body, fetchPost } = this.props

@@ -89,0 +88,0 @@ if (!initialized) {

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