
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
interserver-react
Advanced tools
IntersectionObserver simplified
Checkout the main interserver
package.
With yarn
:
yarn add interserver-react
With npm
:
npm install --save interserver-react
The useInterserver
function takes the same options as the interserver
function (top
, right
, bottom
, left
and once
).
import React from "react";
import useInterserver from "interserver-react";
const MyComponent = () => {
const { isIntersecting, setRef } = useIntersector();
return (
<div ref={setRef}>
{isIntersecting ? "Now you see me!" : "Oh, the darkness..."}
</div>
);
};
You can build a LazyImage
component, that only requests an image, when it is approaching the viewport:
// LazyImage.jsx
import React from "react";
import useInterserver from "interserver-react";
const LazyImage = ({ alt, src, srcSet, ...props }) => {
const { isIntersecting, setRef } = useInterserver({
once: true,
top: 50,
right: 50,
bottom: 50,
left: 50,
});
const imgSrc = isIntersecting ? src : undefined;
const imgSrcSet = isIntersecting ? srcSet : undefined;
return (
<img
{...props}
src={imgSrc}
srcSet={imgSrcSet}
alt={alt}
ref={setRef}
/>
);
};
LazyImage.propTypes = propTypes;
LazyImage.defaultProps = defaultProps;
export default LazyImage;
MIT
FAQs
IntersectionObserver simplified
We found that interserver-react 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.