Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@inertiajs/react

Package Overview
Dependencies
Maintainers
3
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@inertiajs/react - npm Package Compare versions

Comparing version
2.3.23
to
2.3.24
+19
-16
dist/index.esm.js

@@ -1111,9 +1111,13 @@ // src/index.ts

onBeforeNextRequest: () => setLoadingNext(true),
onCompletePreviousRequest: () => {
onCompletePreviousRequest: ({ completed }) => {
setLoadingPrevious(false);
syncStateFromDataManager();
if (completed) {
syncStateFromDataManager();
}
},
onCompleteNextRequest: () => {
onCompleteNextRequest: ({ completed }) => {
setLoadingNext(false);
syncStateFromDataManager();
if (completed) {
syncStateFromDataManager();
}
},

@@ -1472,17 +1476,16 @@ onDataReset: syncStateFromDataManager

}) {
const pollRef = useRef5(
router7.poll(interval, requestOptions, {
...options,
autoStart: false
})
);
const latest = useRef5(requestOptions);
latest.current = requestOptions;
const pollRef = useRef5(null);
useEffect10(() => {
if (options.autoStart ?? true) {
pollRef.current.start();
}
return () => pollRef.current.stop();
pollRef.current = router7.poll(
interval,
typeof requestOptions === "function" ? () => latest.current() : requestOptions,
{ ...options, autoStart: options.autoStart ?? true }
);
return () => pollRef.current?.destroy();
}, []);
return {
stop: pollRef.current.stop,
start: pollRef.current.start
stop: () => pollRef.current?.stop(),
start: () => pollRef.current?.start()
};

@@ -1489,0 +1492,0 @@ }

@@ -1117,9 +1117,13 @@ "use strict";

onBeforeNextRequest: () => setLoadingNext(true),
onCompletePreviousRequest: () => {
onCompletePreviousRequest: ({ completed }) => {
setLoadingPrevious(false);
syncStateFromDataManager();
if (completed) {
syncStateFromDataManager();
}
},
onCompleteNextRequest: () => {
onCompleteNextRequest: ({ completed }) => {
setLoadingNext(false);
syncStateFromDataManager();
if (completed) {
syncStateFromDataManager();
}
},

@@ -1472,17 +1476,16 @@ onDataReset: syncStateFromDataManager

}) {
const pollRef = (0, import_react16.useRef)(
import_core8.router.poll(interval, requestOptions, {
...options,
autoStart: false
})
);
const latest = (0, import_react16.useRef)(requestOptions);
latest.current = requestOptions;
const pollRef = (0, import_react16.useRef)(null);
(0, import_react16.useEffect)(() => {
if (options.autoStart ?? true) {
pollRef.current.start();
}
return () => pollRef.current.stop();
pollRef.current = import_core8.router.poll(
interval,
typeof requestOptions === "function" ? () => latest.current() : requestOptions,
{ ...options, autoStart: options.autoStart ?? true }
);
return () => pollRef.current?.destroy();
}, []);
return {
stop: pollRef.current.stop,
start: pollRef.current.start
stop: () => pollRef.current?.stop(),
start: () => pollRef.current?.start()
};

@@ -1489,0 +1492,0 @@ }

{
"name": "@inertiajs/react",
"version": "2.3.23",
"version": "2.3.24",
"license": "MIT",

@@ -65,3 +65,3 @@ "description": "The React adapter for Inertia.js",

"lodash-es": "^4.18.1",
"@inertiajs/core": "2.3.23"
"@inertiajs/core": "2.3.24"
},

@@ -68,0 +68,0 @@ "scripts": {

import { PollOptions, ReloadOptions } from '@inertiajs/core';
export default function usePoll(interval: number, requestOptions?: ReloadOptions, options?: PollOptions): {
stop: VoidFunction;
start: VoidFunction;
export default function usePoll(interval: number, requestOptions?: ReloadOptions | (() => ReloadOptions), options?: PollOptions): {
stop: () => void | undefined;
start: () => void | undefined;
};

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display