# react-dynamics

> User interaction building blocks for React

Latest version **0.10.1** (published 2019-04-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-dynamics
pnpm add react-dynamics
yarn add react-dynamics
bun add react-dynamics
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.10.1 |
| Published | 2019-04-29 |
| First published | 2017-01-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 27.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Nick Matantsev |
| Maintainers | unframework |
| Keywords | react |

## Links

- npm: https://www.npmjs.com/package/react-dynamics
- Repository: https://github.com/beamworks/react-dynamics
- Homepage: https://github.com/beamworks/react-dynamics#readme
- Issues: https://github.com/beamworks/react-dynamics/issues
- npm.io page: https://npm.io/package/react-dynamics

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.10.1 (latest) — 2019-04-29
- 0.10.0 — 2019-04-29
- 0.9.1 — 2019-04-10
- 0.9.0 — 2019-04-10
- 0.8.0 — 2018-10-23
- 0.7.0 — 2018-09-03
- 0.6.0 — 2018-05-29
- 0.5.0 — 2018-01-03
- 0.4.1 — 2017-09-19
- 0.4.0 — 2017-09-12
- 0.3.0 — 2017-08-22
- 0.2.0 — 2017-08-16
- 0.1.0 — 2017-07-22
- 0.0.3 — 2017-05-11
- 0.0.2 — 2017-01-27
- … 1 more at https://npm.io/package/react-dynamics/versions

## README

# react-dynamics

User interaction building blocks for React

## Overview

This library defines simple building blocks for coding complex interactions.

Approach:

- declarative, JSX-oriented
- some assembly effort required
- extra care to avoid timing bugs
- composition using [function-as-child](https://medium.com/merrickchristensen/function-as-child-components-5f3920a9ace9) technique

Core elements:

- `Data`: request data on demand and asynchronously wait for result
- `Op`: trigger long-running action and report its results to the user
- `Task`: status tracker started and stopped via user events (for e.g. dropdowns, popups)
- `Delay`: basic timeout state triggered via prop

## Op Usage

Simple usage example of the `Op` component:

```
<Op
    action={() => doSomethingReturningPromise()}
    onComplete={result => doSomethingElseUnlessAlreadyUnmounted(result)}
>
    {(invoke, isPending, lastOp) =>
        <form onSubmit={() => invoke()} action="javascript:void(0)">
            {lastOp && lastOp.isError
                ? <var>Please try again! Error: {lastOp.error}</var>
                : null
            }

            {isPending ? <Spinner/> : null}

            ... input elements, etc ...

            <button type="submit" disabled={isPending}>Submit</button>
        </form>
    }
</Op>
```

---
_Source: https://npm.io/package/react-dynamics · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
