
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@re-frame/preact
Advanced tools
1. Make your store available via React context by using `Provider` from `@re-frame/react` at the top of your application. This will allow you to access subscriptions and dispatch events within the React tree.
Provider
from @re-frame/react
at the top of your application. This will allow you to access subscriptions and dispatch events within the React tree.import {h, render} from "preact"
import {createStore} from "@re-frame/standalone"
import {Provider} from "@re-frame/preact"
const store = createStore()
const App = () => (
<Provider store={store}>
<YourAppGoesHere />
</Provider>
)
render(<App />, document.getElementById("root"))
import {h} from "preact"
import {useSubscription} from "@re-frame/preact"
const ChatList = () => {
const chats = useSubscription(["chats"])
return (
<ol>
{chats.map(chat => (
<li key={chat.id}>{chat.title}</li>
)}
</ol>
)
}
import {h} from "preact"
import {useDispatch} from "@re-frame/preact"
// Dispatch will only fire once in this example
const ChatList = () => {
useDispatch(["load-chats"])
// ... more logic here
}
// Dispatch will fire every time `filter` changes
const ChatList = ({filter}) => {
useDispatch(["load-chats", filter])
// ... more logic here
}
// useDispatch also returns a "dispatch" function
const ChatList = () => {
const dispatch = useDispatch() // does not dispatch anything
const onClick = () => {
dispatch(["some-click-event"])
}
// ... more logic here
}
FAQs
1. Make your store available via React context by using `Provider` from `@re-frame/preact` at the top of your application. This will allow you to access subscriptions and dispatch events within the React tree.
The npm package @re-frame/preact receives a total of 7 weekly downloads. As such, @re-frame/preact popularity was classified as not popular.
We found that @re-frame/preact 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 researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.