Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
solid-ts-hooks
Advanced tools
Solid-ts-hooks Solidjs hook library, ready to use, written in Typescript.
npm i solid-ts-hooks
yarn add solid-ts-hooks
pnpm add solid-ts-hooks
createClickOutside
import { createClickOutside} from "solid-ts-hooks";
const setRef = createClickOutside(() => {
console.log("click outside");
});
return (
<div ref={setRef}>Click outside me</div>
)
createLocalStorage
import { createLocalStorage } from "solid-ts-hooks";
const [data, setData] = useLocalStorage('some-data', {})
setData({ name: "Paul" })
return (
<div>Your name is {data()?.name}</div>
)
createDarkMode
import { createDarkMode} from "solid-ts-hooks";
const { isDarkMode, enable, toggle, disable } = createDarkMode(true);
return (
<div>Your mode is {isDarkMode() ? "Dark" : "Light"}</div>
)
createIntersectingObserver
import { createIntersectingObserver} from "solid-ts-hooks";
const { setRef, isVisible } = createIntersectingObserver({});
return (
<div ref={setRef}>I am {isVisible() ? "visible" : "invisible"}</div>
)
createMap
import { createMap} from "solid-ts-hooks";
const [map, actions] = createMap<string, string>(initialValues)
const set = () => actions.set(String(Date.now()), '📦')
const setAll = () => actions.setAll(otherValues)
const reset = () => actions.reset()
const remove = () => actions.remove('hello')
return (
<div ref={setRef}>
<button onClick={set}>Add</button>
<button onClick={reset}>Reset</button>
<button onClick={setAll}>Set new data</button>
<button onClick={remove} disabled={!map.get('hello')}>
{'Remove "hello"'}
</button>
</div>
)
createMediaQuery
import { createMediaQuery } from "solid-ts-hooks";
const matches = createMediaQuery ('(min-width: 768px)')
return (
<div>{`The view port is ${matches ? 'at least' : 'less than'} 768 pixels wide`}</div>
)
createWindowScroll
import { createWindowScroll} from "solid-ts-hooks";
createWindowScroll(() => {
console.log("scroll")
})
createWindowSize
import { createWindowSize} from "solid-ts-hooks";
const { width, height} = createWindowSize()
console.log(width(), height())
FAQs
Solid-ts-hooks Solidjs hook library, ready to use, written in Typescript.
The npm package solid-ts-hooks receives a total of 0 weekly downloads. As such, solid-ts-hooks popularity was classified as not popular.
We found that solid-ts-hooks 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.