
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
@reonomy/reactive-hooks
Advanced tools
$ yarn add @reonomy/reactive-hooks
Reactive Hooks is a library for rendering RxJS Observables using React Hooks.
Returns a current value and a function to update it.
[foo, setFoo] = useRxState(foo$);
Example:
import React from 'react';
import { useRxState } from '@reonomy/reactive-hooks';
import { Observable } from 'rxjs';
interface IFoo {
foo$: Observable<string>;
}
function Foo({ foo$ }: IFoo) {
const [foo, setFoo] = useRxState(foo$);
return (
<button onClick={() => setFoo('bar')}>
{foo}
</button>
);
}
During the initial render, the returned state foo
is the same as the current value passed as the first argument foo$
.
The button click handler will update foo$
and set this state to bar
.
Returns a current state of a given observable.
foo = useRxStateResult(foo$);
Example:
import React from 'react';
import { useRxState } from '@reonomy/reactive-hooks';
import { Observable } from 'rxjs';
interface IFoo {
foo$: Observable<string>;
}
function FooReader({ foo$ }: IFoo) {
const foo = useRxStateResult(foo$);
return (
<p>
{foo}
</p>
);
}
Invokes a callback function when a given observable emits a new state.
useRxEffect(foo$, didUpdate);
Example:
import React from 'react';
import { useRxState } from '@reonomy/reactive-hooks';
import { Observable } from 'rxjs';
interface IFoo {
foo$: Observable<string>;
}
function FooReader({ foo$ }: IFoo) {
useRxEffect(foo$, (foo) => {
console.log('new foo is ', foo);
});
return <p>Foo<p>;
}
Returns an ajax response and a function to submit a request. In addition it invokes a callback function on state updates (e.g. when status is changed from pending
to succeeded
/failed
).
[response, submitRequest] = useRxAjax(ajaxFoo, didUpdate);
The callback function is useful when a side effect should be invoked.
Invokes a callback function with a given debounce timeout when a given observable emites a new state.
[response, submitRequest] = useRxDebounce(useRxDebounce, didUpdate, timeout);
Invokes a callback function when a component is mounted and rendered for the very first time.
useMountEffect(didMount);
MIT
FAQs
RxJS React Hooks Library
The npm package @reonomy/reactive-hooks receives a total of 4 weekly downloads. As such, @reonomy/reactive-hooks popularity was classified as not popular.
We found that @reonomy/reactive-hooks demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.