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

react-infinite-scroll-container

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-infinite-scroll-container - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

18

dist/InfiniteScroll.js

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

_this.attachedScroller = false;
_this.scrollListener = _this.scrollListener.bind(_this);

@@ -44,3 +45,3 @@ return _this;

this.pageLoaded = this.props.pageStart;
this.attachScrollListener();
if (this.props.hasMore) this.attachScrollListener();
if (this.props.initialLoad) {

@@ -58,3 +59,6 @@ this.props.loadMore(this.pageLoaded);

}
if (nextProps.resetPageLoader && !this.props.resetPageLoader) this.pageLoaded = this.props.pageStart;
if (nextProps.resetPageLoader && !this.props.resetPageLoader) {
this.attachScrollListener();
this.pageLoaded = this.props.pageStart;
}
}

@@ -75,3 +79,4 @@ }, {

totalItemsCount = _props.totalItemsCount,
props = _objectWithoutProperties(_props, ['children', 'element', 'hasMore', 'initialLoad', 'loader', 'loadMore', 'pageStart', 'threshold', 'useWindow', 'totalItemsCount']);
resetPageLoader = _props.resetPageLoader,
props = _objectWithoutProperties(_props, ['children', 'element', 'hasMore', 'initialLoad', 'loader', 'loadMore', 'pageStart', 'threshold', 'useWindow', 'totalItemsCount', 'resetPageLoader']);

@@ -113,6 +118,5 @@ return _react2.default.createElement(element, props, children, hasMore && (loader || this._defaultLoader));

value: function attachScrollListener() {
if (!this.props.hasMore && !this.props.resetPageLoader) {
return;
}
if (this.attachedScroller) return;
this.attachedScroller = true;
var scrollEl = window;

@@ -133,3 +137,3 @@ if (this.props.useWindow == false) {

}
this.attachedScroller = false;
scrollEl.removeEventListener('scroll', this.scrollListener);

@@ -136,0 +140,0 @@ scrollEl.removeEventListener('resize', this.scrollListener);

{
"name": "react-infinite-scroll-container",
"version": "1.0.7",
"version": "1.0.8",
"description": "Infinite scroll component for React in ES6",

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

@@ -28,2 +28,3 @@ import React, { Component, PropTypes } from 'react';

super(props);
this.attachedScroller = false;
this.scrollListener = this.scrollListener.bind(this);

@@ -34,3 +35,3 @@ }

this.pageLoaded = this.props.pageStart;
this.attachScrollListener();
if(this.props.hasMore) this.attachScrollListener();
if (this.props.initialLoad) {

@@ -47,3 +48,6 @@ this.props.loadMore(this.pageLoaded);

}
if (nextProps.resetPageLoader && !this.props.resetPageLoader) this.pageLoaded = this.props.pageStart;
if (nextProps.resetPageLoader && !this.props.resetPageLoader ) {
this.attachScrollListener();
this.pageLoaded = this.props.pageStart;
}
}

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

totalItemsCount,
resetPageLoader,
...props

@@ -99,6 +104,5 @@ } = this.props;

attachScrollListener() {
if(!this.props.hasMore && !this.props.resetPageLoader) {
return;
}
if (this.attachedScroller) return
this.attachedScroller = true;
let scrollEl = window;

@@ -118,3 +122,3 @@ if(this.props.useWindow == false) {

}
this.attachedScroller = false;
scrollEl.removeEventListener('scroll', this.scrollListener);

@@ -121,0 +125,0 @@ scrollEl.removeEventListener('resize', this.scrollListener);

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