Socket
Socket
Sign inDemoInstall

react-redux-alerts

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-redux-alerts - npm Package Compare versions

Comparing version 1.5.3 to 1.5.4

12

lib/alertContainer.js

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

var defaultState = {
isVisible: false,
message: ''
};
var createAlert = function createAlert(config) {

@@ -78,4 +83,7 @@ return function (WrappedComponent) {

function mapStateToProps(state) {
return { isVisible: state.alerts ? state.alerts[alertName] : false };
if (!state[alertName]) return defaultState;
return {
isVisible: state[alertName].isVisible,
message: state[alertName].message
};
};

@@ -82,0 +90,0 @@

2

package.json
{
"name": "react-redux-alerts",
"version": "1.5.3",
"version": "1.5.4",
"description": "A lightweight library for creating keyed alerts in a Redux app",

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

@@ -6,2 +6,7 @@ import React, { Component } from 'react';

const defaultState = {
isVisible: false,
message: ''
};
const createAlert = config => WrappedComponent => {

@@ -31,4 +36,7 @@ const { alertName } = config;

function mapStateToProps (state) {
return { isVisible: state.alerts ? state.alerts[alertName] : false };
if (!state[alertName]) return defaultState;
return {
isVisible: state[alertName].isVisible,
message: state[alertName].message
};
};

@@ -35,0 +43,0 @@

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