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

treble-hook

Package Overview
Dependencies
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

treble-hook - npm Package Compare versions

Comparing version 0.0.19 to 0.0.20

19

lib/index.js

@@ -28,5 +28,18 @@ "use strict";

if (topicRecord) {
Object.values(topicRecord.subscriptionMap).forEach(publicHook => publicHook[TupleIndex.Publish](newState));
topicRecord.currentState = newState;
topicRecord.hasBeenPublished = true;
const allowDupeState = false;
const suppressDupeStateWarning = false;
let proceed = true;
if (!allowDupeState) {
const currentStateCompare = JSON.stringify(topicRecord.currentState);
const newStateCompare = JSON.stringify(newState);
proceed = newStateCompare !== currentStateCompare;
}
if (proceed) {
Object.values(topicRecord.subscriptionMap).forEach(publicHook => publicHook[TupleIndex.Publish](newState));
topicRecord.currentState = newState;
topicRecord.hasBeenPublished = true;
}
else if (!suppressDupeStateWarning) {
console.warn('[treble-hook] A publish of unchanged state was attempted for topic:', topic, '\n\nIf this is desired behavior then set the allowDupeState flag to true in treble-hook config.');
}
}

@@ -33,0 +46,0 @@ else {

2

package.json
{
"name": "treble-hook",
"version": "0.0.19",
"version": "0.0.20",
"description": "Get hooked on simple subscribe-and-publish in ReactJS.",

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

Sorry, the diff of this file is not supported yet

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