0.5.1 • Published 6 years ago

react-async-call v0.5.1

Weekly downloads
6
License
MIT
Repository
github
Last release
6 years ago

react-async-call

npm version Build Status codecov

Overview

Declarative promise handling in React.

Install

Using npm

npm i react-async-call --save

Then, use it as usual:

// using ES6 modules
import createAsyncCallComponent from 'react-async-call'

// using CommonJS modules
var createAsyncCallComponent = require('react-async-call').createAsyncCallComponent

UMD build

The UMD build is also available on unpkg:

<script src="https://unpkg.com/react-async-call"></script>

The package is avalable on window.ReactAsyncCall

Usage

Basic Usage

import createAsyncCallComponent from 'react-async-call'

const AsyncCall = createAsyncCallComponent(value => Promise.resolve(42))

const Example = () => (
  <AsyncCall>
    <AsyncCall.Running>
      <div>Loading...</div>
    </AsyncCall.Running>
    <AsyncCall.HasResult>{result => <div>The result of function call is {result}</div>}</AsyncCall.HasResult>
    <AsyncCall.Rejected>{reason => <div>Error: {reason}</div>}</AsyncCall.Rejected>
  </AsyncCall>
)

Data Fetching

Incremental Data Fetching

API

See API reference here

Change Log

You can find change log here

Credits

Great thanks to @kitos and @ventrz for their invaluable help, support and bright ideas!

0.5.2-alpha

6 years ago

0.5.1

6 years ago

0.5.1-alpha.1

6 years ago

0.5.1-alpha

6 years ago

0.5.0

6 years ago

0.4.0

6 years ago

0.4.0-alpha.1

6 years ago

0.4.0-alpha

6 years ago

0.3.1

6 years ago

3.1.0

6 years ago

0.3.1-alpha.11

6 years ago

0.3.1-alpha.10

6 years ago

0.3.1-alpha.9

6 years ago

0.3.1-alpha.8

6 years ago

0.3.1-alpha.7

6 years ago

0.3.1-alpha.6

6 years ago

0.3.1-alpha.5

6 years ago

0.3.1-alpha.4

6 years ago

0.3.1-alpha.3

6 years ago

0.3.1-alpha.2

6 years ago

0.3.1-alpha.1

6 years ago

0.3.1-alpha

6 years ago

3.0.1

6 years ago

0.2.8

6 years ago

0.2.7

6 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.3.0

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.2.0-alpha.6

6 years ago

0.2.0-alpha.5

6 years ago

0.2.0-alpha.4

6 years ago

0.2.0-alpha.3

6 years ago

0.2.0-alpha.2

6 years ago

0.1.20

6 years ago

0.2.0-alpha.1

6 years ago

0.2.0-alpha.0

6 years ago

0.1.19

6 years ago

0.0.0

6 years ago