Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
infinite-autocomplete
Advanced tools
The infinite-autocomplete component is like all these autocomplete out there, except that he is "Infinite" - which means that scrolling will fetch more data
Ease of use, written totally in Pure Functional Programming mindset!
npm i -S infinite-autocomplete
import InfiniteAutocomplete from 'infinite-autocomplete';
// Static data source
InfiniteAutocomplete({
data: [
{ text: 'Islam Attrash', value: 1},
{ text: 'Shai Reznik', value: 2},
{ text: 'Uri Shaked', value: 3},
{ text: 'Salsabel Eawissat', value: 4}
],
onSelect: ({ id, text }) => {
// do something useful!
}
}, document.getElementById('app'));
// Dynamic data source
InfiniteAutocomplete({
value: 'test', // input initial value
data: (text, page, fetchSize) => {
return new Promise(function(resolve) {
fetch(`http://localhost:5000/data?text=${text}&page=${page}&fetchSize=${fetchSize}`)
.then((response) => response.json())
.then((options) => resolve(options))
});
}
}, document.getElementById('app'));
InfiniteAutocomplete function is also a curried function! which means that we can set a specific configuration and render the autocomplete with these configurations for multiple DOM nodes!
const citiesInfinite = InfiniteAutocomplete({
data: () => new Promise((resolve) => {
...
resolve(cities);
})
});
// Some page
const firstCities = citiesInfinite(DOM1);
// Another page
citiesInfinite(DOM2);
// You can update the options by passing the new slice into setState
firstCities.setState({ fetchSize: 15 });
// You can destroy the component by calling destroy
firstCities.destroy();
{
/**
* current value
*/
value?: string;
/**
* data source
*/
data?: IOption[] | (inputText: string, fetchSize: number, page: number) => Promise<IOption[]>;
/**
* Chunk fetch size
*/
fetchSize?: number,
/**
* on-select event output handler when choosing an option
*/
onSelect?(IOption);
}
Where IOption
stands for =>
interface IOption {
id: number | string;
text: string;
}
FAQs
infinite-autocomplete
The npm package infinite-autocomplete receives a total of 53 weekly downloads. As such, infinite-autocomplete popularity was classified as not popular.
We found that infinite-autocomplete 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.