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

@neo4j-nvl/react

Package Overview
Dependencies
Maintainers
3
Versions
165
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@neo4j-nvl/react - npm Package Compare versions

Comparing version 0.1.7 to 0.1.8

2

lib/basic-wrapper/BasicNvlWrapper.d.ts

@@ -70,3 +70,5 @@ import { NamedExoticComponent } from 'react';

nvlOptions?: NvlOptions;
/** A callback to handle any errors that happen during NVL initialization */
onInitializationError?: (error: unknown) => void;
}>;
export { BasicNvlWrapper };

23

lib/basic-wrapper/BasicNvlWrapper.js

@@ -59,3 +59,3 @@ import React, { useEffect, useState, useRef, forwardRef, useImperativeHandle, memo } from 'react';

*/
const BasicNvlWrapper = memo(forwardRef(({ nodes, rels, layout, layoutOptions, nvlCallbacks = {}, nvlOptions }, ref) => {
const BasicNvlWrapper = memo(forwardRef(({ nodes, rels, layout, layoutOptions, nvlCallbacks = {}, nvlOptions, onInitializationError }, ref) => {
useImperativeHandle(ref, () => {

@@ -75,8 +75,19 @@ const nvlMethods = Object.getOwnPropertyNames(NVL.prototype);

}
const newNvl = new NVL(containerRef.current, currentNodes, currentRels, combinedOptions, nvlCallbacks);
setNvl(newNvl);
setCurrentRels(rels);
setCurrentNodes(nodes);
let newNvl;
try {
newNvl = new NVL(containerRef.current, currentNodes, currentRels, combinedOptions, nvlCallbacks);
setNvl(newNvl);
setCurrentRels(rels);
setCurrentNodes(nodes);
}
catch (e) {
if (typeof onInitializationError === 'function') {
onInitializationError(e);
}
else {
throw e;
}
}
return () => {
newNvl.destroy();
newNvl === null || newNvl === void 0 ? void 0 : newNvl.destroy();
};

@@ -83,0 +94,0 @@ }

{
"name": "@neo4j-nvl/react",
"version": "0.1.7",
"version": "0.1.8",
"main": "lib/index.js",

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

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