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

expiring-redux-messages

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

expiring-redux-messages - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

10

lib/actions.js

@@ -13,6 +13,9 @@ 'use strict';

function showMessage(message, lifetime) {
var rating = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2];
return {
type: _types.SHOW_MESSAGE,
message: message,
lifetime: lifetime
lifetime: lifetime,
rating: rating
};

@@ -22,6 +25,9 @@ }

function addMessage(message, id) {
var rating = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2];
return {
type: _types.ADD_MESSAGE,
message: message,
id: id
id: id,
rating: rating
};

@@ -28,0 +34,0 @@ }

3

lib/middleware.js

@@ -28,2 +28,3 @@ 'use strict';

var lifetime = action.lifetime;
var rating = action.rating;

@@ -36,5 +37,5 @@ var id = (0, _helpers.pseudoRandomID)();

return store.dispatch((0, _actions.addMessage)(message, id));
return store.dispatch((0, _actions.addMessage)(message, id, rating));
};
};
};

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

id: action.id,
message: action.message
message: action.message,
rating: action.rating
}]);

@@ -27,0 +28,0 @@ case _types.REMOVE_MESSAGE:

{
"name": "expiring-redux-messages",
"version": "0.2.0",
"version": "0.3.0",
"description": "create messages that will remove themselves",

@@ -5,0 +5,0 @@ "files": [

@@ -32,3 +32,3 @@ #Expiring Redux Messages

store.dispatch(
sendMessage(message, 10000)
sendMessage(message, 10000, 1)
);

@@ -54,1 +54,9 @@

```
##`sendMessage`
`sendMessage` takes three arguments:
1. message (string) - the message that should be displayed
2. lifetime (int) - the number of milliseconds that the message should last for
3. rating (int) - the rating of the message. While not required, a good way to think about the rating is to coincide it with its sign. A rating that is less than 0 is negative, a rating that is greater than 0 is positive, and a rating of 0 is neutral. If you do not provide a rating, it will default to 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