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

@codescouts/ui

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codescouts/ui - npm Package Compare versions

Comparing version 1.0.15 to 1.0.16

4

lib/Events/useEvent.d.ts

@@ -1,6 +0,6 @@

import { Handler } from "@codescouts/events";
import { DomainEvent, Handler } from "@codescouts/events";
import { Ref } from "@codescouts/di";
export declare const useEvents: () => {
attach: (...handlers: Ref<Handler<any>>[]) => void;
attach: (...handlers: Ref<Handler<DomainEvent>>[]) => void;
};
//# sourceMappingURL=useEvent.d.ts.map

@@ -22,4 +22,6 @@ "use strict";

var react_1 = require("react");
var resolvedHandlers = [];
var useEvents = function () {
var _a = __read((0, react_1.useState)([]), 2), _ = _a[0], setHandlers = _a[1];
var _a = __read((0, react_1.useState)(false), 2), isLoaded = _a[0], setIsLoaded = _a[1];
var _b = __read((0, react_1.useState)([]), 2), handlers = _b[0], setHandlers = _b[1];
var attach = function () {

@@ -30,10 +32,18 @@ var handlers = [];

}
var newHandlers = handlers.map(function (h) {
return (0, di_1.useResolve)(h);
setHandlers(handlers);
};
(0, react_1.useEffect)(function () {
if (!isLoaded)
return;
resolvedHandlers.forEach(function (handler) { return handler.dispose(); });
resolvedHandlers = handlers.map(function (handler) {
return (0, di_1.useResolve)(handler);
});
setHandlers(function (prev) {
prev.forEach(function (h) { return h.dispose(); });
return newHandlers;
});
};
}, [handlers, isLoaded]);
(0, react_1.useEffect)(function () {
setIsLoaded(true);
return function () {
resolvedHandlers.forEach(function (handler) { return handler.dispose(); });
};
}, []);
return {

@@ -40,0 +50,0 @@ attach: attach,

{
"name": "@codescouts/ui",
"version": "1.0.15",
"version": "1.0.16",
"main": "./lib/index.js",

@@ -5,0 +5,0 @@ "types": "./lib/index.d.ts",

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