Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
solid-infinite-scroll-fork
Advanced tools
Infinite scrolling / Dynamic list loading library for SolidJS
First, install the library from the npm registry:
yarn add -D solid-infinite-scroll
Second, import it in the tsx component you're working on:
import InfiniteScroll from 'solid-infinite-scroll';
To use the infinite scroll module, you would need a signal/resource for data storage, and implement two functions:
each
should return the currently stored data array, this is similar to the SolidJS <For>
componenthasMore
should return true if more data is availablenext
should load more data into the array stored by each
and return nothingFor example, if you want to load all data at once but only display e.g. 50 at a time, you can do:
const fetchApi = async () => await (await fetch("https://api.example.com/list").json() as string[]
export default function App() {
const [api] = createResource(fetchApi)
const [scrollIndex, setScrollIndex] = createSignal(50)
const scrollNext = () => setScrollIndex(Math.min(scrollIndex() + 50, api().length))
return (
<InfiniteScroll each={api()?.slice(0, scrollIndex())}
hasMore={scrollIndex() < api()?.length}
next={scrollNext}>
{(item, index) =>
<div>{item}</div>
}
</InfiniteScroll>
)
}
FAQs
infinite scroll library for solid-js
The npm package solid-infinite-scroll-fork receives a total of 0 weekly downloads. As such, solid-infinite-scroll-fork popularity was classified as not popular.
We found that solid-infinite-scroll-fork demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.