0.5.1 • Published 7 years ago

react-async-call v0.5.1

Weekly downloads
6
License
MIT
Repository
github
Last release
7 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

7 years ago

0.5.1

7 years ago

0.5.1-alpha.1

7 years ago

0.5.1-alpha

7 years ago

0.5.0

7 years ago

0.4.0

7 years ago

0.4.0-alpha.1

7 years ago

0.4.0-alpha

7 years ago

0.3.1

7 years ago

3.1.0

7 years ago

0.3.1-alpha.11

7 years ago

0.3.1-alpha.10

7 years ago

0.3.1-alpha.9

7 years ago

0.3.1-alpha.8

7 years ago

0.3.1-alpha.7

7 years ago

0.3.1-alpha.6

7 years ago

0.3.1-alpha.5

7 years ago

0.3.1-alpha.4

7 years ago

0.3.1-alpha.3

7 years ago

0.3.1-alpha.2

7 years ago

0.3.1-alpha.1

7 years ago

0.3.1-alpha

7 years ago

3.0.1

7 years ago

0.2.8

7 years ago

0.2.7

7 years ago

0.2.6

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.3.0

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.2.0-alpha.6

7 years ago

0.2.0-alpha.5

7 years ago

0.2.0-alpha.4

7 years ago

0.2.0-alpha.3

7 years ago

0.2.0-alpha.2

7 years ago

0.1.20

7 years ago

0.2.0-alpha.1

7 years ago

0.2.0-alpha.0

7 years ago

0.1.19

7 years ago

0.0.0

7 years ago