Skip to content

Samuel-Carnell/react-with-rxjs

Repository files navigation

npm GitHub Workflow Status npm bundle size GitHub

React with RxJS

A single API for binding RXJS Observables to your React components.

Install

npm install react-with-rxjs

Usage

const useTicks = bind(() => {
	return { tick: interval(100).pipe(take(1000)) };
});

function Ticks() {
	const { tick } = useTicks();
	return (
		<div style={{ textAlign: 'center' }}>
			<h2>Timer: {tick}</h2>
		</div>
	);
}

Documentation

Full documentation can be found here

License

MIT License | Copyright (c) 2022 Samuel Carnell