New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

evt

Package Overview
Dependencies
Maintainers
2
Versions
186
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

evt - npm Package Compare versions

Comparing version 2.0.0-beta.43 to 2.0.0-beta.44

5

hooks/useRerenderOnStateChange.js

@@ -30,5 +30,6 @@ "use strict";

function useRerenderOnStateChange(evt) {
var _a = __read(useState(evt.state), 2), setState = _a[1];
//NOTE: We use function in case the state is a function
var _a = __read(useState(function () { return evt.state; }), 2), setState = _a[1];
useEvt_1.useEvt(function (ctx) {
return evt.attach(ctx, function (state) { return setState(state); });
return evt.attach(ctx, function (state) { return setState(function () { return state; }); });
}, [evt]);

@@ -35,0 +36,0 @@ }

2

package.json
{
"name": "evt",
"version": "2.0.0-beta.43",
"version": "2.0.0-beta.44",
"description": "Type safe replacement for node's EventEmitter",

@@ -5,0 +5,0 @@ "repository": {

@@ -19,9 +19,10 @@ import { useEvt } from "./useEvt";

const [,setState]=useState(evt.state);
//NOTE: We use function in case the state is a function
const [, setState] = useState(() => evt.state);
useEvt(
ctx =>
evt.attach(ctx, state => setState(state)),
evt.attach(ctx, state => setState(() => state)),
[evt]
);
}

Sorry, the diff of this file is not supported yet

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