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

react-remote-resource

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-remote-resource - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

15

dist/cjs.js

@@ -267,2 +267,9 @@ 'use strict';

var mounted = React.useRef(true);
React.useEffect(function () {
return function () {
mounted.current = false;
};
}, []);
if (task) {

@@ -274,5 +281,9 @@ throw task;

return setTask(fn().then(function () {
setTask(null);
if (mounted.current) {
setTask(null);
}
}).catch(function () {
setTask(null);
if (mounted.current) {
setTask(null);
}
}));

@@ -279,0 +290,0 @@ };

2

package.json
{
"name": "react-remote-resource",
"version": "0.1.1",
"version": "0.1.2",
"description": "Intuitive remote data management in React",

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

@@ -1,6 +0,14 @@

import { useState } from "react";
import { useState, useRef, useEffect } from "react";
const useSuspense = fn => {
const [task, setTask] = useState(null);
const mounted = useRef(true);
useEffect(
() => () => {
mounted.current = false;
},
[]
);
if (task) {

@@ -14,6 +22,10 @@ throw task;

.then(() => {
setTask(null);
if (mounted.current) {
setTask(null);
}
})
.catch(() => {
setTask(null);
if (mounted.current) {
setTask(null);
}
})

@@ -20,0 +32,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