
Security News
GitHub Actions Checkout Now Blocks Risky pull_request_target Checkouts
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.
@kuindji/observable-react
Advanced tools
React hooks for Observable (@kuindji/observable)
import Observable from "@kuindji/observable"
import { useOn } from "@kuindji/observable-react"
function MyComponent() {
// create it here or get from somewhere else
const observable = useMemo(() => new Observable(), []);
// all parameters are dynamic
useOn(observable, "eventName", callbackFunction, options = {});
useOn(observable, {
eventName1: callbackFunction1,
eventName2: callbackFunction2
});
useOn(observable, [
{ name: "eventName1", listener: callbackFunction1, options = {}},
{ name: "eventName2", listener: callbackFunction2, options = {}}
]);
return (
<></>
)
}
useObservable is a useContext wrapper and Provider is a predefined Context.
import Observable from "@kuindji/observable"
import { useOn, useObservable, Provider } from "@kuindji/observable-react"
function App() {
const observable = useMemo(() => new Observable(), []);
return (
<Provider observable={ observable }>
<MyComponent/>
</Provider>
)
}
function MyComponent() {
const observable = useObservable();
useOn(observable, ...);
return (...)
}
import { createContext } from "react"
import Observable from "@kuindji/observable"
import { useObservable, Provider } from "@kuindji/observable-react"
const ObservableContext = createContext();
function App() {
const observable = useMemo(() => new Observable(), []);
return (
<ObservableContext.Provider value={ observable }>
<MyComponent/>
</ObservableContext.Provider>
)
}
function MyComponent() {
const observable = useObservable(ObservableContext);
}
FAQs
React hooks for Observable (@kuindji/observable)
The npm package @kuindji/observable-react receives a total of 7 weekly downloads. As such, @kuindji/observable-react popularity was classified as not popular.
We found that @kuindji/observable-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.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.