
Research
/Security News
Mini Shai-Hulud Campaign Hits Red Hat Cloud Services npm Packages
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.
@jnsdls/rx-react-render
Advanced tools
A rxjs observable -> render function component for React.
You can either install the module via npm or yarn:
npm install @jnsdls/rx-react-render --save
yarn add @jnsdls/rx-react-render
I wanted a dead simple way to get rxjs observable values rendered. Existing solutions included all kinds of capabilities that I did not need. All I wanted is to pass an observable, and get its value as it changed over time passed through a render function.
RxReactRender makes no assumptions about how you create your observables or what data they contain. Instead it handles subscribtion & unsubscription and gives you the current values. That's it.
A very simple and minimal example of how to set up RxReactRender which takes an interval() observable and renders a span with the elapsed seconds inside.
import React from 'react';
import ReactDOM from 'react-dom';
import { interval } from 'rxjs';
import RxReactRender from '@jnsdls/rx-react-render';
ReactDOM.render(
<RxReactRender interval={interval(1000)}>
{({ interval }) => <span>Elapsed Seconds: {interval}</span>}
</RxReactRender>,
document.getElementById('root')
);
import React from 'react';
import ReactDOM from 'react-dom';
import { interval } from 'rxjs';
import RxReactRender from '@jnsdls/rx-react-render';
ReactDOM.render(
<RxReactRender interval={interval(1000)} title="Elapsed Seconds (as prop):">
{({ interval, title }) => (
<span>
{title} {interval}
</span>
)}
</RxReactRender>,
document.getElementById('root')
);
import React from 'react';
import ReactDOM from 'react-dom';
import { BehaviorSubject } from 'rxjs';
import { map } from 'rxjs/operators';
import RxReactRender from '@jnsdls/rx-react-render';
const inputState$ = new BehaviorSubject('');
ReactDOM.render(
<RxReactRender
inputValue={inputState$.pipe(
map(str =>
str
.split('')
.reverse()
.join('')
)
)}
title="This input will reverse your input on every key press:"
>
{({ inputValue, title }) => (
<span>
{title} <input value={inputValue} onChange={e => inputState$.next(e.target.value)} />
</span>
)}
</RxReactRender>,
document.getElementById('root')
);
| Name | Type | Default | Description |
|---|---|---|---|
| children | function | null | A render function that will receive an object of values that map to the observables you passed |
| observables | Observable | null | Any observable you pass will be subscribed to and the valye passed into the render function |
| other props | any | null | Any non-observable props you pass will not be touched and simply forwarded into the render function |
MIT
FAQs
Turn observable props into a render function with values.
The npm package @jnsdls/rx-react-render receives a total of 8 weekly downloads. As such, @jnsdls/rx-react-render popularity was classified as not popular.
We found that @jnsdls/rx-react-render 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
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.

Security News
The Rust project is moving toward formal rules on LLM use in contributions after months of internal debate over maintainer burden, code quality, and contributor experience.