2.1.0 • Published 8 months ago

react-promise-client v2.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

React promise client

This is a lightweight promise handler.

using npm

npm i react-promise-client

In React:

    const { data, isLoading, execute } = usePromise({
            promiseFn: ()=> asyncAwaitFunction(),
            onSuccess results => console.log(results),
            onFailure: error => console.log(error);
    }, [...deps])

    return isLoading? <div>Loading...</div> : <div>done...</div>
  • execute: execute promise manually and wait for results in data.
  • data: results from promise call.
  • isLoading: true when busy, else false.
  • deps: dependencies like any other hook, this is optional
2.1.0

8 months ago

2.0.0

10 months ago

1.1.1-2

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago

0.0.1-19

1 year ago

0.0.1-18

1 year ago

0.0.1-15

1 year ago

0.0.1-14

1 year ago

0.0.1-13

1 year ago

0.0.1-12

1 year ago

0.0.1-11

1 year ago