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

@paroicms/bo-app-log

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@paroicms/bo-app-log - npm Package Compare versions

Comparing version 1.5.0 to 1.6.0

2

dist/index.d.ts

@@ -8,2 +8,4 @@ import { type AppLog, type FullAppLog } from "./app-log";

export declare function useWrapAsync(): WrapAsync;
export type AsyncEffect = Promise<void | (() => void | Promise<void>)>;
export declare function useAsyncEffect(effect: () => AsyncEffect, deps: readonly unknown[]): void;
export declare const AppLogProvider: import("react").Provider<FullAppLog>;

@@ -1,2 +0,2 @@

import { createContext, useContext } from "react";
import { createContext, useContext, useEffect, useRef } from "react";
import { createNoAppLog } from "./app-log";

@@ -12,2 +12,31 @@ export * from "./app-log";

}
export function useAsyncEffect(effect, deps) {
const logger = useContext(AppLogContext);
const enqueueCalling = useRef(); // to resist to React strict mode
useEffect(() => {
let readyCleanup;
let promise;
if (enqueueCalling.current) {
promise = enqueueCalling.current.then(callEffect);
}
else {
promise = callEffect();
}
enqueueCalling.current = promise;
function callEffect() {
return effect().then((cleanup) => {
readyCleanup = cleanup ?? (() => { });
return cleanup;
}, logger.error);
}
return () => {
if (readyCleanup) {
readyCleanup()?.catch(logger.error); // cleanup synchronously if possible
}
else {
promise.then((cleanup) => cleanup?.()).catch(logger.error);
}
};
}, deps);
}
export const AppLogProvider = AppLogContext.Provider;

5

package.json
{
"name": "@paroicms/bo-app-log",
"version": "1.5.0",
"version": "1.6.0",
"description": "Logger for the BO front of a Paroi CMS.",

@@ -30,5 +30,2 @@ "keywords": [

},
"peerDependencies": {
"react": "~18.3.1"
},
"files": [

@@ -35,0 +32,0 @@ "dist"

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