Neighborly Package Megalodon

    @react-infinity/fetch-react

    1.1.2 • Public • Published

    fetch-react

    Featching data using React Component.

    Installation

    Add dependency to your project.

    npm install @react-infinity/fetch-react --save

    Quick Start

    import React from 'react';
    import Fetch, {Loading, Success, Error, Initialize} 
    from '@react-infinity/fetch-react';
    
    const App = () => (
        <div>
            <Fetch url={'https://jsonplaceholder.typicode.com/todos/1'}>
                <Initialize>
                    {() => (<div>"Initialize"</div>)}
                </Initialize>
    
                <Loading>
                    {() => (<div>"Loading"</div>)}
                </Loading>
    
                <Success>
                    {(data) => (<div>Success {JSON.stringify(data)}</div>)}
                </Success>
    
                <Error>
                    {(data) => (<div>Error {JSON.stringify(data)}</div>)}
                </Error>
    
            </Fetch>
        </div>
    );

    Author

    Oussama MESSAOUDI - @Oussama Messaoudi

    Install

    npm i @react-infinity/fetch-react

    DownloadsWeekly Downloads

    7

    Version

    1.1.2

    License

    ISC

    Unpacked Size

    13.6 kB

    Total Files

    11

    Last publish

    Collaborators

    • ouss_mess