Socket
Socket
Sign inDemoInstall

react-redux-toastr

Package Overview
Dependencies
Maintainers
1
Versions
134
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-redux-toastr - npm Package Compare versions

Comparing version 4.4.6 to 5.0.0

10

lib/reducer.js

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

exports.default = (0, _utils.createReducer)(initialState, (_createReducer = {}, _defineProperty(_createReducer, _constants.ADD_TOASTR, function (state, _ref) {
var type = _ref.type,
var id = _ref.id,
type = _ref.type,
title = _ref.title,

@@ -47,3 +48,3 @@ message = _ref.message,

var newToastr = {
id: (0, _utils.guid)(),
id: id || (0, _utils.guid)(),
type: type,

@@ -91,3 +92,4 @@ title: title,

}), _defineProperty(_createReducer, _constants.SHOW_CONFIRM, function (state, _ref2) {
var message = _ref2.message,
var id = _ref2.id,
message = _ref2.message,
options = _ref2.options;

@@ -97,3 +99,3 @@

confirm: {
id: (0, _utils.guid)(),
id: id || (0, _utils.guid)(),
show: true,

@@ -100,0 +102,0 @@ message: message,

@@ -126,3 +126,4 @@ 'use strict';

if (!this.isHiding && (removeOnHover || this.shouldClose)) {
this._setIntervalId(setTimeout(this._removeToastr, 1000));
var interval = removeOnHover === true ? 1000 : removeOnHover;
this._setIntervalId(setTimeout(this._removeToastr, interval));

@@ -134,3 +135,3 @@ var progressBar = this.props.item.options.progressBar;

if (timeOut && progressBar) {
this.setState({ progressBar: { duration: 1000 } });
this.setState({ progressBar: { duration: interval } });
}

@@ -137,0 +138,0 @@ }

2

package.json
{
"name": "react-redux-toastr",
"version": "4.4.6",
"version": "5.0.0",
"description": "react-redux-toastr is a React toastr message implemented with Redux",

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

@@ -21,3 +21,3 @@ import {createReducer, guid} from './utils.js';

export default createReducer(initialState, {
[ADD_TOASTR]: (state, {type, title, message, options, ignoreToastr}) => {
[ADD_TOASTR]: (state, {id, type, title, message, options, ignoreToastr}) => {
if (ignoreToastr) {

@@ -28,3 +28,3 @@ return state;

const newToastr = {
id: guid(),
id: id || guid(),
type,

@@ -82,7 +82,7 @@ title,

},
[SHOW_CONFIRM]: (state, {message, options}) => {
[SHOW_CONFIRM]: (state, {id, message, options}) => {
return {
...state,
confirm: {
id: guid(),
id: id || guid(),
show: true,

@@ -89,0 +89,0 @@ message,

@@ -108,3 +108,4 @@ import CSSCore from 'fbjs/lib/CSSCore';

if (!this.isHiding && (removeOnHover || this.shouldClose)) {
this._setIntervalId(setTimeout(this._removeToastr, 1000));
const interval = removeOnHover === true ? 1000 : removeOnHover;
this._setIntervalId(setTimeout(this._removeToastr, interval));

@@ -115,3 +116,3 @@ const {progressBar} = this.props.item.options;

if (timeOut && progressBar) {
this.setState({progressBar: {duration: 1000}});
this.setState({progressBar: {duration: interval}});
}

@@ -118,0 +119,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