Gathering detailed insights and metrics for redux-infinite-scroll
Gathering detailed insights and metrics for redux-infinite-scroll
Gathering detailed insights and metrics for redux-infinite-scroll
Gathering detailed insights and metrics for redux-infinite-scroll
@types/redux-infinite-scroll
TypeScript definitions for redux-infinite-scroll
ngx-infinite-scroll
[![Build Status](https://travis-ci.org/orizens/ngx-infinite-scroll.svg?branch=master)](https://travis-ci.org/orizens/ngx-infinite-scroll) [![Backers on Open Collective](https://opencollective.com/ngx-infinite-scroll/backers/badge.svg)](#backers) [![Sponso
react-infinite-scroll-component
An Infinite Scroll component in react.
react-infinite-scroll-hook
A simple hook to create infinite scroll components
npm install redux-infinite-scroll
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
178 Stars
37 Commits
47 Forks
6 Watching
4 Branches
8 Contributors
Updated on 05 Sept 2023
JavaScript (97.49%)
CSS (1.98%)
HTML (0.53%)
Cumulative downloads
Total Downloads
Last day
-8.9%
51
Compared to previous day
Last week
10%
242
Compared to previous week
Last month
6%
1,003
Compared to previous month
Last year
-19.6%
15,477
Compared to previous year
25
A stateless React infinite scroll component meant for usage within Redux.
If you are using an element as the scrollable component, rather than the window, you MUST pass a fixed height to the containerHeight prop (many issues will be fixed by following this step).
http://realscout.github.io/redux-infinite-scroll/
1npm install redux-infinite-scroll --save
1import ReduxInfiniteScroll from 'redux-infinite-scroll';
1var ReduxInfiniteScroll = require('redux-infinite-scroll');
If you decide to use either one of the distribution files found in /dist
, then you can access the ReduxInfiniteScroll
via a global variable.
1ReduxInfiniteScroll
1ReduxInfiniteScroll.default;
The difference is due to the ReduxInfiniteScroll
being an ES6 module and therefore having a different export syntax than ES5.
In order to use it in your React app, simply import it and follow the example below. The component expects to receive
child elements that it then injects into the DOM. The loadMore
prop expects a function that requests for more
items to be loaded once the container/window has reached the bottom threshold
. If there are no more items left to
be passed to the component, make sure to set the hasMore
prop to be false
. Important If you are using
an element as the scrollable component, rather than the window, you MUST pass a fixed height to the containerHeight
prop.
1 2// MessageList.jsx 3 4import InfiniteScroll from 'redux-infinite-scroll'; 5import ChatActions from './ChatActions'; 6 7class MessageList extends Component { 8 _loadMore() { 9 this.props.dispatch(ChatActions.fetchMessages()) 10 } 11 12 _renderMessages() { 13 return _.map(this.props.messages, (msg) => { 14 return( 15 <div>{msg}</div> 16 ) 17 }) 18 } 19 20 render() { 21 return ( 22 <InfiniteScroll 23 items={this._renderMessages()} 24 loadMore={this._loadMore.bind(this)} 25 /> 26 ) 27 } 28} 29
Where your Redux action and reducer might look something like this:
1// ChatActions.js 2 3export function fetchMessages(params) { 4 return { 5 type: FETCH_MESSAGES, 6 messages: ['hi there', 'hi again', 'still here'] 7 }; 8} 9 10 11// ChatReducer.js 12 13 14const initialState = { 15 messages: [] 16} 17 18function chatReducer(state=initialState, action=undefined) { 19 switch (action.type) { 20 case FETCH_MESSAGES: 21 return Object.assign({}, initialState, { 22 messages: initialState.concat(action.messages) 23 }) 24 } 25} 26
Props | Type | Required | Default | Description |
---|---|---|---|---|
elementIsScrollable | bool | no | true | Defines whether the div will have a fixed height and listens to the div's overflow event or instead have a non-fixed height and listen to the window scroll event |
containerHeight | integer or string | no | '100%' | Sets an inline style on the height of the topmost div. |
threshold | integer | no | 100 | The number of pixels from the bottom that the scroll bar must reach in order to trigger loadMore . |
horizontal | bool | no | false | Whether to check for horizontal scrolling |
hasMore | bool | no | true | Whether there are more items waiting to be displayed. Set this to false once all of the items have been passed down to either items or children . |
loadingMore | bool | no | false | A prop that should be set to true by the parent component whenever the loadMore function gets invoked, and then toggled to false once that function has finished updating the items prop. |
loader | any | no | Loading... | The value of this prop gets injected as the last element of the parent div when hasMore loadingMore and showLoader are all true . |
showLoader | bool | no | true | Whether to show the loader when the loadingMore property is true |
loadMore | function | yes | undefined | The function is called when the component has reached the threshold and hasMore is true. |
holderType | string | no | div | The type the loader is rendered as, could be ul , dl , etc. |
className | string | no | '' | Any additional classes to be added to the holder. |
items | array | no | [] | The array of elements waiting to be rendered. Use either this or children . Deprecated. |
children | array | no | [] | The array of elements waiting to be rendered. Use either this or items . |
RealScout Heavily inspired by react-infinite-scroll.
MIT Licensed. Copyright (c) RealScout Inc.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 7/30 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More