@inquirer/core
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -73,2 +73,6 @@ "use strict"; | ||
function useEffect(cb, depArray) { | ||
const rl = sessionRl; | ||
if (!rl) { | ||
throw new Error('useEffect must be used within a prompt'); | ||
} | ||
const _idx = index; | ||
@@ -84,3 +88,3 @@ index++; | ||
cleanupHook(_idx); | ||
const cleanFn = cb(); | ||
const cleanFn = cb(rl); | ||
if (cleanFn != null && typeof cleanFn !== 'function') { | ||
@@ -87,0 +91,0 @@ throw new Error('useEffect return value must be a cleanup function or nothing.'); |
@@ -73,2 +73,6 @@ "use strict"; | ||
function useEffect(cb, depArray) { | ||
const rl = sessionRl; | ||
if (!rl) { | ||
throw new Error('useEffect must be used within a prompt'); | ||
} | ||
const _idx = index; | ||
@@ -84,3 +88,3 @@ index++; | ||
cleanupHook(_idx); | ||
const cleanFn = cb(); | ||
const cleanFn = cb(rl); | ||
if (cleanFn != null && typeof cleanFn !== 'function') { | ||
@@ -87,0 +91,0 @@ throw new Error('useEffect return value must be a cleanup function or nothing.'); |
{ | ||
"name": "@inquirer/core", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"engines": { | ||
@@ -97,3 +97,3 @@ "node": ">=14.18.0" | ||
}, | ||
"gitHead": "86531864067faf1d6e76f1581c9aa72cb1b03753" | ||
"gitHead": "d48ecde923e5875de631f7b50f67cfaf00384947" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
55871
1083