0.3.1 • Published 7 years ago

react-requests v0.3.1

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

react-requests

HTTP requests, the React way.

npm npm

Disclaimer: The project currently is in its infancy. The APIs may or may not change. We are totally unsure if there are any cons to this approach. Checkout the Philosophy page, to get an idea why we created this package. If you disagree, we wanna listen :ear:, or rather read :book:.

Installation

npm install react-requests

Example

import Request from 'react-requests';

<Request
    url='https://my-awesome-doma.in/me'
    onSuccess={this.myAwesomeResponseHandler}/>

    {/*
    Request element can have only one Child,
    when using React-DOM it will be <div>,
    when using React-native it will be <View>,
    the limitation is because of the issue
    See: https://github.com/facebook/react/issues/2127
    */}

    <div>
        <Request.Start>
            <MyAwesomeSpinner />
        </Request.Start>
        <Request.Success>
            <MyAwesomeContent />
        </Request.Success>
        <Request.Failure>
            <MyAwesomeErrorMessage />
        </Request.Failure>
    </div>
</Request>

Recipes

Check out the Recipes page.

Contribution

Any and all the contribution is welcome, providing it aligns with the interest of the project. Please make sure the commit messages follow the convention from the git commit template.

0.3.1

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago