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

react-twitter-widgets

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-twitter-widgets - npm Package Compare versions

Comparing version 0.2.3 to 0.2.4

26

dist/components/AbstractWidget.js

@@ -35,2 +35,7 @@ 'use strict';

_createClass(AbstractWidget, [{
key: 'componentWillMount',
value: function componentWillMount() {
this.willUnmount = false;
}
}, {
key: 'componentDidMount',

@@ -46,2 +51,7 @@ value: function componentDidMount() {

}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
this.willUnmount = true;
}
}, {
key: 'loadWidget',

@@ -65,3 +75,5 @@ value: function loadWidget() {

value: function done() {
this.removeChildrenExceptLast(this.refs.widgetWrapper);
if (this.willUnmount) {
this.removeChildrenExceptLast(this.refs.widgetWrapper);
}
}

@@ -71,4 +83,6 @@ }, {

value: function removeChildren(node) {
while (node.firstChild) {
node.removeChild(node.firstChild);
if (node) {
while (node.firstChild) {
node.removeChild(node.firstChild);
}
}

@@ -79,4 +93,6 @@ }

value: function removeChildrenExceptLast(node) {
while (node.childNodes.length > 1) {
node.removeChild(node.firstChild);
if (node) {
while (node.childNodes.length > 1) {
node.removeChild(node.firstChild);
}
}

@@ -83,0 +99,0 @@ }

2

package.json
{
"name": "react-twitter-widgets",
"version": "0.2.3",
"version": "0.2.4",
"description": "Twitter widgets as React components",

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

@@ -9,2 +9,6 @@ import React from 'react'

componentWillMount() {
this.willUnmount = false
}
componentDidMount() {

@@ -18,2 +22,6 @@ this.loadWidget()

componentWillUnmount() {
this.willUnmount = true
}
loadWidget() {

@@ -32,8 +40,12 @@ const { widgetWrapper } = this.refs

done() {
this.removeChildrenExceptLast(this.refs.widgetWrapper)
if (this.willUnmount) {
this.removeChildrenExceptLast(this.refs.widgetWrapper)
}
}
removeChildren(node) {
while (node.firstChild) {
node.removeChild(node.firstChild)
if (node) {
while (node.firstChild) {
node.removeChild(node.firstChild)
}
}

@@ -43,4 +55,6 @@ }

removeChildrenExceptLast(node) {
while (node.childNodes.length > 1) {
node.removeChild(node.firstChild)
if (node) {
while (node.childNodes.length > 1) {
node.removeChild(node.firstChild)
}
}

@@ -47,0 +61,0 @@ }

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