react-wait-for-it

0.0.4 • Public • Published

WaitForIt

A promise-ful component that waits to load something

Get it

yarn add react-wait-for-it
# or
npm install --save react-wait-for-it

Use it

import WaitForIt from 'react-wait-for-it';

const MyApp = (props) => (
  <WaitForIt
    promise={fetch('https://jsonplaceholder.typicode.com/users').then(r => r.json())}
    render={data => <Users users={data} />}
  />
)

Play with it

yarn start

localhost:8080

Test it

yarn test

/react-wait-for-it/

    Package Sidebar

    Install

    npm i react-wait-for-it

    Weekly Downloads

    2

    Version

    0.0.4

    License

    MIT

    Unpacked Size

    7.65 kB

    Total Files

    14

    Last publish

    Collaborators

    • mrozbarry