Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-accio

Package Overview
Dependencies
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-accio - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

9

dist/Accio.cjs.js

@@ -452,2 +452,11 @@ 'use strict';

}, {
key: 'componentDidUpdate',
value: function componentDidUpdate(prevProps) {
var fetchKey = this.props.fetchKey;
if (fetchKey && fetchKey(this.props) !== fetchKey(prevProps)) {
this.doWork.call(this);
}
}
}, {
key: 'doWork',

@@ -454,0 +463,0 @@ value: function () {

@@ -446,2 +446,11 @@ import _regeneratorRuntime from 'babel-runtime/regenerator';

}, {
key: 'componentDidUpdate',
value: function componentDidUpdate(prevProps) {
var fetchKey = this.props.fetchKey;
if (fetchKey && fetchKey(this.props) !== fetchKey(prevProps)) {
this.doWork.call(this);
}
}
}, {
key: 'doWork',

@@ -448,0 +457,0 @@ value: function () {

2

package.json
{
"name": "react-accio",
"version": "1.0.1",
"version": "1.1.0",
"description": "Declaratively fetch multiple APIs with a single React component.",

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

@@ -115,2 +115,17 @@ # Accio

### Using fetchKey prop
Use fetchKey prop if you want to re-trigger fetch based on your props.
This example will trigger fetch when prop `url` change:
```jsx
function fetchKey(props) {
return props.url;
}
<Accio url="https://api.example.com/data" fetchKey={fetchKey}>
{renderData}
</Accio>
```
### Using render prop

@@ -117,0 +132,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