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

react-client-async

Package Overview
Dependencies
Maintainers
0
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-client-async - npm Package Compare versions

Comparing version 1.3.4 to 1.3.5

6

dist/libs/hooks/useAsync.js

@@ -1,2 +0,2 @@

import { useCallback, useEffect, useRef, useState } from 'react';
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import sameProps from '../utils/sameProps';

@@ -49,3 +49,3 @@ /**

// The state of the async function.
state: { pending, result, error },
state: useMemo(() => ({ pending, result, error }), [pending, result, error]),
// The load function to run the async function.

@@ -66,3 +66,3 @@ load: useCallback(() => {

const sameRefresh = refreshRef.current === refresh;
const notFirstRun = pending !== undefined || !options.autoLoad;
const notFirstRun = pending != null || !options.autoLoad;
const noChange = sameFn && sameArgs && sameRefresh && notFirstRun;

@@ -69,0 +69,0 @@ const reason = abortCtlRef.current?.signal.reason;

{
"name": "react-client-async",
"version": "1.3.4",
"version": "1.3.5",
"main": "dist/lib.js",

@@ -44,11 +44,11 @@ "module": "dist/lib.js",

"peerDependencies": {
"react": "^17 || ^18 || ^19",
"react-dom": "^17 || ^18 || ^19"
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"@biomejs/biome": "^1.9.4",
"@rsbuild/core": "^1.2.4",
"@rsbuild/core": "^1.2.8",
"@rsbuild/plugin-mdx": "^1.0.2",
"@rsbuild/plugin-react": "^1.1.0",
"@tailwindcss/postcss": "^4.0.3",
"@tailwindcss/postcss": "^4.0.6",
"@tailwindcss/typography": "^0.5.16",

@@ -61,3 +61,3 @@ "@types/gh-pages": "^6.1.0",

"gh-pages": "^6.3.0",
"postcss": "^8.5.1",
"postcss": "^8.5.2",
"postcss-load-config": "^6.0.1",

@@ -68,3 +68,3 @@ "postcss-loader": "^8.1.1",

"react-toastify": "^11.0.3",
"tailwindcss": "^4.0.3",
"tailwindcss": "^4.0.6",
"tsc-alias": "^1.8.10",

@@ -71,0 +71,0 @@ "typescript": "^5.7.3"

@@ -15,5 +15,5 @@ <h1 align="center">

## ๐Ÿ‘‹ Introduction
This package helps you use async function **<u>without</u>** the need to migrate to `โš›๏ธ React 19` and server-side rendering!

@@ -24,2 +24,3 @@

## ๐Ÿš€ Install

@@ -41,2 +42,19 @@

## โœ… `useAsyncMemo` Hook
Use the `useAsyncMemo` hook to create a memoized async task.
```tsx
const {
load, stop,
state: { result, pending, error }
} = useAsyncMemo(({ signal }) =>
fetch("/package.json", { signal })
.then((res) => res.json()),
[/* Function Dependencies */],
{ autoLoad: false },
);
```
## โœ… `Async` Component

@@ -55,4 +73,5 @@

## ๐ŸŽฌ `Demo` of Recursive Async Component
## ๐ŸŽฌ Recursive Async Component Demo
Easy to `wrap` a recursive async component and memoize it.

@@ -74,2 +93,3 @@

## โณ What is Next?

@@ -76,0 +96,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