![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
@ovotech/async-reactor-ts
Advanced tools
Render async Stateless Functional Components in React, using Typescript
Render async Stateless Functional Components, using Typescript
yarn add async-reactor-ts
It has peer dependencies of "react" and "react-dom"
import * as React from 'react';
import { AsyncReactor } from '@ovotech/async-reactor-ts';
const Home = (
<AsyncReactor loader={() => someAsnycStuff()}>
{({ loading, result }) => {
if (loading) {
return <div>Loading</div>;
}
return <div>Home Screen {result}</div>;
}}
</AsyncReactor>
);
You'll receive the result of the async loader call in the "result" prop
If there is an error in the loader, you will receive it as an "error" prop
import * as React from 'react';
import { AsyncReactor } from '@ovotech/async-reactor-ts';
const Home = (
<AsyncReactor loader={() => someAsnycStuff()}>
{({ loading, error }) => {
if (loading) {
return <div>Loading</div>;
}
if (error) {
return <div>Error {error.message}</div>;
}
return <div>Home Screen</div>;
}}
</AsyncReactor>
);
import * as React from 'react';
import { AsyncReactor } from '@ovotech/async-reactor-ts';
const Home = (
<AsyncReactor
loader={async () => {
const data = await fetch('https://jsonplaceholder.typicode.com/posts');
return await data.json();
}}
>
{({ loading, result }) => {
if (loading) {
return <div>Loading</div>;
}
return <ul>{result.map(x => <li key={x.id}>{x.title}</li>)}</ul>;
}}
</AsyncReactor>
);
In order to develop on this package:
git clone git@github.com:ovotech/async-reactor-ts.git
cd async-reactor-ts
yarn
yarn lint
yarn test
New versions are deployed using "Github Releases" feature. We use SemVer for versioning. For the versions available, see npm async-reactor-ts.
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details
Inspired by async-reactor project
FAQs
Render async Stateless Functional Components in React, using Typescript
The npm package @ovotech/async-reactor-ts receives a total of 6 weekly downloads. As such, @ovotech/async-reactor-ts popularity was classified as not popular.
We found that @ovotech/async-reactor-ts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 68 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.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.