0.10.1 • Published 5 years ago

react-dynamics v0.10.1

Weekly downloads
4
License
ISC
Repository
github
Last release
5 years ago

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 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>
0.10.1

5 years ago

0.10.0

5 years ago

0.9.1

5 years ago

0.9.0

5 years ago

0.8.0

6 years ago

0.7.0

6 years ago

0.6.0

6 years ago

0.5.0

6 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago