react-redux-toastr
Advanced tools
Comparing version 6.0.0 to 6.0.1
@@ -7,2 +7,5 @@ 'use strict'; | ||
exports.removeByType = exports.hideConfirm = exports.showConfirm = exports.remove = exports.clean = undefined; | ||
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; }; | ||
exports.add = add; | ||
@@ -23,2 +26,3 @@ | ||
function add(toastr) { | ||
console.log('toastr add: ', toastr); | ||
if (_config2.default.preventDuplicates && (0, _utils.preventDuplication)(_reducer.toastrsCache, toastr)) { | ||
@@ -34,3 +38,5 @@ return { | ||
type: _constants.ADD_TOASTR, | ||
payload: toastr | ||
payload: _extends({ | ||
position: _config2.default.position | ||
}, toastr) | ||
}; | ||
@@ -37,0 +43,0 @@ } |
@@ -119,3 +119,3 @@ 'use strict'; | ||
}, _this2.props)), | ||
item.options.attention && _react2.default.createElement('div', { className: 'toastr-attention' }) | ||
item.options && item.options.attention && _react2.default.createElement('div', { className: 'toastr-attention' }) | ||
); | ||
@@ -122,0 +122,0 @@ }); |
@@ -18,6 +18,2 @@ 'use strict'; | ||
var addToToastr = function addToToastr(type, array) { | ||
return emitter.emit('add/toastr', (0, _utils.mapToToastrMessage)(type, array)); | ||
}; | ||
var actions = {}; | ||
@@ -30,3 +26,3 @@ ['light', 'message', 'info', 'success', 'warning', 'error'].forEach(function (item) { | ||
return addToToastr(item, args); | ||
emitter.emit('add/toastr', (0, _utils.mapToToastrMessage)(item, args)); | ||
}; | ||
@@ -33,0 +29,0 @@ }); |
{ | ||
"name": "react-redux-toastr", | ||
"version": "6.0.0", | ||
"version": "6.0.1", | ||
"description": "react-redux-toastr is a React toastr message implemented with Redux", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -15,2 +15,3 @@ import { | ||
export function add(toastr) { | ||
console.log('toastr add: ', toastr); | ||
if (config.preventDuplicates && preventDuplication(toastrsCache, toastr)) { | ||
@@ -26,3 +27,6 @@ return { | ||
type: ADD_TOASTR, | ||
payload: toastr | ||
payload: { | ||
position: config.position, | ||
...toastr | ||
} | ||
}; | ||
@@ -29,0 +33,0 @@ } |
@@ -93,3 +93,3 @@ import React from 'react'; | ||
/> | ||
{item.options.attention && <div className="toastr-attention" />} | ||
{item.options && item.options.attention && <div className="toastr-attention" />} | ||
</span> | ||
@@ -96,0 +96,0 @@ ); |
@@ -5,7 +5,7 @@ import {mapToToastrMessage} from './utils.js'; | ||
const addToToastr = (type, array) => emitter.emit('add/toastr', mapToToastrMessage(type, array)); | ||
let actions = {}; | ||
['light', 'message', 'info', 'success', 'warning', 'error'].forEach(item => { | ||
actions[item] = (...args) => addToToastr(item, args); | ||
actions[item] = (...args) => { | ||
emitter.emit('add/toastr', mapToToastrMessage(item, args)); | ||
}; | ||
}); | ||
@@ -12,0 +12,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
120236
1998