
Security News
PodRocket Podcast: Inside the Recent npm Supply Chain Attacks
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
@solid-primitives/connectivity
Advanced tools
A navigator.onLine
signal that tells you when the browser thinks you're online. Connectivity is determined by your browser, which is a best-effort process.
makeConnectivityListener
- Attaches event listeners and fires callback whenever window.onLine
changes.createConnectivitySignal
- A signal representing the browser's interpretation of whether it is on- or offline.npm install @solid-primitives/connectivity
# or
yarn add @solid-primitives/connectivity
makeConnectivityListener
Attaches event listeners and fires callback whenever window.onLine
changes.
import { makeConnectivityListener } from "@solid-primitives/connectivity";
const clear = makeConnectivityListener(isOnline => {
console.log(isOnline); // T: booelan
});
// remove event listeners (happens also on cleanup)
clear();
function makeConnectivityListener(callback: (isOnline: boolean) => void): VoidFunction;
createConnectivitySignal
A signal representing the browser's interpretation of whether it is on- or offline.
import { createConnectivitySignal } from "@solid-primitives/connectivity";
const isOnline = createConnectivitySignal();
isOnline(); // T: boolean
useConnectivitySignal
This primitive provides a singleton root variant that will reuse event listeners and signals across dependents.
It's behavior is the same as createConnectivitySignal
.
import { useConnectivitySignal } from "@solid-primitives/connectivity";
const isOnline = useConnectivitySignal();
isOnline(); // T: boolean
function createConnectivitySignal(): Accessor<boolean>;
https://codesandbox.io/s/solid-primitives-connectivity-demo-2m76q?file=/index.tsx
See CHANGELOG.md
FAQs
A navigator.onLine signal.
The npm package @solid-primitives/connectivity receives a total of 215 weekly downloads. As such, @solid-primitives/connectivity popularity was classified as not popular.
We found that @solid-primitives/connectivity demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers 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
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.