Skip to content

Commit

Permalink
add skip to lazy loader
Browse files Browse the repository at this point in the history
  • Loading branch information
alijany committed Jun 23, 2024
1 parent 63831d7 commit 00ecf9b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.7.1",
"version": "0.7.2",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down
9 changes: 8 additions & 1 deletion src/lazyQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,14 @@ export function createLazyHook<


const fetchPromise = useMemo(() => {

if (options.skip) {
return {
read() {
return undefined
},
}
}

const compiledUrl = replaceUrlParam(url, options.pathParams ?? {});

return wrapPromise(axiosInstance<ResType>({
Expand Down

0 comments on commit 00ecf9b

Please sign in to comment.