react-redux-alerts
Advanced tools
Comparing version 1.3.14 to 1.3.15
@@ -55,6 +55,15 @@ 'use strict'; | ||
}, { | ||
key: 'close', | ||
value: function close() { | ||
this.props.actions.dismissAlert(alertName); | ||
} | ||
}, { | ||
key: 'render', | ||
value: function render() { | ||
var _this2 = this; | ||
if (!this.props.isVisible) return false; | ||
return _react2.default.createElement(WrappedComponent, null); | ||
return _react2.default.createElement(WrappedComponent, { close: function close() { | ||
return _this2.close(); | ||
} }); | ||
} | ||
@@ -61,0 +70,0 @@ }]); |
{ | ||
"name": "react-redux-alerts", | ||
"version": "1.3.14", | ||
"version": "1.3.15", | ||
"description": "A lightweight library for creating keyed alerts in a Redux app", | ||
"main": "./lib/index.js", | ||
"scripts": { | ||
"test": "mocha --compilers js:babel-register --recursive './test/'", | ||
"test": "mocha --compilers js:babel-register --recursive ", | ||
"test-watch": "./node_modules/mocha/bin/mocha test --watch --recursive", | ||
@@ -9,0 +9,0 @@ "build:lib": "babel src --out-dir lib", |
@@ -17,6 +17,10 @@ import React, { Component } from 'react'; | ||
} | ||
close() { | ||
this.props.actions.dismissAlert(alertName); | ||
} | ||
render() { | ||
if(!this.props.isVisible) return false; | ||
return ( | ||
<WrappedComponent /> | ||
<WrappedComponent close={() => this.close()} /> | ||
); | ||
@@ -23,0 +27,0 @@ } |
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
21051
16
418
1
65