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

cancelbl

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cancelbl - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

package.json
{
"name": "cancelbl",
"version": "1.0.0",
"version": "1.0.1",
"description": "Yet another make-cancelable Promise wrapper",

@@ -5,0 +5,0 @@ "main": "dist/cancelbl.js",

@@ -19,6 +19,6 @@ # cancelbl

For React components, that use [fetch](https://developer.mozilla.org/en/docs/Web/API/Fetch_API) to update the state, unmounting can lead to the following issue:
```
setState(…): Can only update a mounted or mounting component.
This usually means you called setState() on an unmounted component. This is a no-op
```
>setState(…): Can only update a mounted or mounting component.
>This usually means you called setState() on an unmounted component. This is a no-op
The correct way to fix this issue, according to [the article](https://facebook.github.io/react/blog/2015/12/16/ismounted-antipattern.html), is to cancel any callbacks in `componentWillUnmount`, prior to unmounting.

@@ -112,2 +112,6 @@ Suggested `makeCancelable` wraps target promise and returns `cancel()` function, which can be called in `componentWillUnmount`.

## Other implementations
Please check out [react-unplug](https://github.com/sergeysolovev/react-unplug)
## Contributing

@@ -114,0 +118,0 @@

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