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

react-offcharts-core

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-offcharts-core - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

2

_test_/Chart.test.jsx

@@ -38,3 +38,3 @@ import React from 'react';

Chart.prototype.onResize.restore();
expect(spyOne.callCount).toBe(3);
expect(spyOne.callCount).toBe(2);
Component2.unmount();

@@ -41,0 +41,0 @@ });

@@ -18,2 +18,6 @@ 'use strict';

var _resizeObserverPolyfill = require('resize-observer-polyfill');
var _resizeObserverPolyfill2 = _interopRequireDefault(_resizeObserverPolyfill);
var _ReactIf = require('./ReactIf');

@@ -63,3 +67,3 @@

if (_this.props.responsive === true) {
_this.resize = (0, _lodash2.default)(_this.onResize.bind(_this), 150);
_this.onResize = _this.onResize.bind(_this);
}

@@ -76,4 +80,9 @@ return _this;

value: function componentDidMount() {
var _this2 = this;
if (this.props.responsive === true) {
window.addEventListener('resize', this.resize);
this.ro = new _resizeObserverPolyfill2.default(function (ent, obs) {
(0, _lodash2.default)(_this2.onResize(), 250);
});
this.ro.observe(this.chart);
}

@@ -89,4 +98,4 @@ this.onResize();

value: function componentWillUnmount() {
if (this.props.responsive === true) {
window.removeEventListener('resize', this.resize);
if (this.ro) {
this.ro.disconnect();
}

@@ -113,3 +122,3 @@ }

value: function render() {
var _this2 = this;
var _this3 = this;

@@ -140,3 +149,3 @@ // Copy the state to pass down to the children

ref: function ref(c) {
_this2.chart = c;
_this3.chart = c;
},

@@ -143,0 +152,0 @@ id: this.props.id,

{
"name": "react-offcharts-core",
"version": "0.1.5",
"version": "0.1.6",
"description": "A Core Library for React Offcharts",

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

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