New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@alextewpin/use-promise

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alextewpin/use-promise - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

2

package.json
{
"name": "@alextewpin/use-promise",
"version": "0.2.1",
"version": "0.2.2",
"author": "Alexander Tewpin <alex.tewpin@gmail.com> (https://github.com/alextewpin)",

@@ -5,0 +5,0 @@ "repository": {

@@ -97,8 +97,8 @@ # use-promise

| Parameter | Type | Desrciption |
| -------------- | ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `promise` | `Promise<Data>` | Promise, that will automatically runned on mount. Mutually exclusive with `promiseThunk`. Dependent on every other parameter. |
| `promiseThunk` | `(payload: Payload) => Promise<Data>` | Function that returns promise, can be called manually with `run`. Mutually exclusive with `promise`. |
| `onResolve` | `(data: Data) => any` | Function that will be called on promise resolution. |
| `onReject` | `(error: Error) => any` | Function that will be called on promise rejection. |
| Parameter | Type | Desrciption |
| --------------- | ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `promise?` | `Promise<Data>` | Promise, that will automatically runned on mount. Mutually exclusive with `promiseThunk`. Dependent on every other parameter. |
| `promiseThunk?` | `(payload: Payload) => Promise<Data>` | Function that returns promise, can be called manually with `run`. Mutually exclusive with `promise`. |
| `onResolve?` | `(data: Data) => any` | Function that will be called on promise resolution. |
| `onReject?` | `(error: Error) => any` | Function that will be called on promise rejection. |

@@ -109,5 +109,5 @@ ### interface PromiseState<Data, Payload>

| ----------- | ---------------------------- | ---------------------------------------- |
| `data` | `Data \| undefined` | Result of resolved promise. |
| `error` | `Error \| undefined` | Error of rejected promise. |
| `data?` | `Data` | Result of resolved promise. |
| `error?` | `Error` | Error of rejected promise. |
| `isPending` | `boolean` | Promise pending status. |
| `run` | `(payload: Payload) => void` | Run `promiseThunk` with given `Payload`. |
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc