musicq / Vist
Licence: mit
Virtual-list component build with react and rxjs
Stars: ✭ 81
Programming Languages
typescript
32286 projects
Projects that are alternatives of or similar to Vist
Inferno Most Fp Demo
A demo for the ReactJS Tampa Bay meetup showing how to build a React+Redux-like architecture from scratch using Inferno, Most.js, reactive programmning, and various functional programming tools & techniques
Stars: ✭ 45 (-44.44%)
Mutual labels: rxjs
Rx Marble Design System
A design system to visualize functional reactive programming based on ReactiveExtensions
Stars: ✭ 60 (-25.93%)
Mutual labels: rxjs
Withobservables
HOC (Higher-Order Component) for connecting RxJS Observables to React Components
Stars: ✭ 41 (-49.38%)
Mutual labels: rxjs
Reactivity
A Bleeding Edge React Universal Boilerplate for Power Users.
Stars: ✭ 79 (-2.47%)
Mutual labels: rxjs
Rxstate
Simple opinionated state management library based on RxJS
Stars: ✭ 46 (-43.21%)
Mutual labels: rxjs
Until Destroy
🦊 RxJS operator that unsubscribe from observables on destroy
Stars: ✭ 1,071 (+1222.22%)
Mutual labels: rxjs
Evolui
A tiny reactive user interface library, built on top of RxJs.
Stars: ✭ 43 (-46.91%)
Mutual labels: rxjs
Angular1 Async Filter
Angular2 async pipe implemented as Angular 1 filter to handle promises & RxJS observables
Stars: ✭ 59 (-27.16%)
Mutual labels: rxjs
Time
A time driver designed to enable awesome testing and dev tooling
Stars: ✭ 80 (-1.23%)
Mutual labels: rxjs
Ant Simple Pro
简洁,美观,快速上手,支持3大框架(vue3.0,react,angular,typescript);Concise, beautiful, quick to get started, support 3 big frameworks
Stars: ✭ 73 (-9.88%)
Mutual labels: rxjs
vist
Virtual-list component build with react and rxjs
Selling Point
Vist won't create or remove any DOM when you scroll the list, it will reuse the existing DOM and only change their position and data. But when you resize your window, you'll find the DOM's number is changed, so your virtual list will always have just right number of DOM.
Install
npm install --save vist
Usage
import React from 'react';
import { VirtualList } from 'vist';
class App extends Component {
constructor(props) {
super(props);
const data = new Array(5000).fill(0).map((_, i) => i);
this.state = {
data: of(data)
};
}
render() {
return (
<VirtualList
data$={this.state.data}
options$={of({ height: 60 })}
style={{ height: 400, border: '1px solid black' }}>
{(item, index) => (
<p style={{ height: 59, margin: 0, borderBottom: '1px solid green' }}>
No. {index} - {item}
</p>
)}
</VirtualList>
);
}
}
Props
Property | Type | Description |
---|---|---|
data$ |
Observable<any> |
Data source of the list. |
options$ |
Observable<IVirtualListOptions> |
Options of the virtual list. |
style |
`{[key: string]: string | number}` |
className |
string |
className of VirtualList container. |
keepDom |
boolean |
Determine whether to reuse the dom. |
uniqKey |
string |
The key field of list to identify. |
IVirtualListOptions
Property | Type | Default | Description |
---|---|---|---|
height |
number |
NOT NULL | Item height, it's necessary, vist use this property to calculate how many rows should be rendered actually. |
spare |
number |
3 | Spare rows out of the view. |
sticky |
boolean |
true | Whether the scrollTop need to stick to the container's top when the data is changed or not. |
startIndex |
number |
0 | To indicate this start index of the list, and the list will scroll to this start index position when mounted. |
resize |
boolean |
true | To mark if the real dom number should be recomputed when the window resize. |
License
MIT © musicq
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].