export default (function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,_,$,aa,ab,ac,ad,ae){return {data:{navigation:[{title:"Blockchain",_path:"\u002Fblockchain",children:[{title:"Common Typescript Examples",_path:"\u002Fblockchain\u002Fcommon-typescript-examples"},{title:"Smart Contracts",_path:"\u002Fblockchain\u002Fsmart-contracts"}]},{title:"Css",_path:"\u002Fcss",children:[{title:"Automatic Grid Like Masonry With Pure CSS",_path:"\u002Fcss\u002Fautomatic-grid-like-masonry-with-pure-css"},{title:"Sass Nth Child Iterate Mixin",_path:"\u002Fcss\u002Fsass-nth-child-iterate-mixin"},{title:"Test If Browser Supports CSS Rules",_path:"\u002Fcss\u002Ftest-if-browser-supports-css-rules"}]},{title:"Docker",_path:"\u002Fdocker",children:[{title:"Building Static Pages With Docker",_path:"\u002Fdocker\u002Fbuilding-static-pages-with-docker"},{title:"Drone Ci",_path:"\u002Fdocker\u002Fdrone-ci"},{title:"Github Pages With Drone Ci",_path:"\u002Fdocker\u002Fgithub-pages-with-drone-ci"},{title:"Private Docker Registry",_path:"\u002Fdocker\u002Fprivate-docker-registry"},{title:"Refresh Containers On Pull",_path:"\u002Fdocker\u002Frefresh-containers-on-pull"},{title:"Seed Dump Inside Docker",_path:"\u002Fdocker\u002Fseed-dump-inside-docker"},{title:"Wait For Mysql",_path:"\u002Fdocker\u002Fwait-for-mysql"},{title:"Wait For Redis",_path:"\u002Fdocker\u002Fwait-for-redis"}]},{title:"Frontend",_path:"\u002Ffrontend",children:[{title:"React Native",_path:"\u002Ffrontend\u002Freact-native",children:[{title:"OAuth2 Login",_path:"\u002Ffrontend\u002Freact-native\u002Foauth2-login"},{title:"Preserve FlatList Scroll Position In React Native",_path:"\u002Ffrontend\u002Freact-native\u002Fpreserve-flatlist-scroll-position-in-react-native"},{title:"Useful Comands",_path:"\u002Ffrontend\u002Freact-native\u002Fuseful-comands"}]},{title:"React",_path:"\u002Ffrontend\u002Freact",children:[{title:"Axios Refresh Token On React",_path:"\u002Ffrontend\u002Freact\u002Faxios-refresh-token-on-react"},{title:G,_path:H}]},{title:"Vue",_path:"\u002Ffrontend\u002Fvue",children:[{title:"Adding Global Properties To Component",_path:"\u002Ffrontend\u002Fvue\u002Fadding-global-properties-to-component"},{title:"Make Nuxt Handle Obsidian Highlights",_path:"\u002Ffrontend\u002Fvue\u002Fmake-nuxt-handle-obsidian-highlights"}]}]},{title:"Git",_path:"\u002Fgit",children:[{title:"Force Git To Use HTTPS",_path:"\u002Fgit\u002Fforce-git-to-use-https"},{title:"Git Aliases And Useful Commands",_path:"\u002Fgit\u002Fgit-aliases-and-useful-commands"}]},{title:"Graphql",_path:"\u002Fgraphql",children:[{title:"Apollo Client Pagination",_path:"\u002Fgraphql\u002Fapollo-client-pagination"},{title:"Refresh Token In Apollo Client",_path:"\u002Fgraphql\u002Frefresh-token-in-apollo-client"}]},{title:"Linux",_path:"\u002Flinux",children:[{title:"Gitea For Git Hosting",_path:"\u002Flinux\u002Fgitea-for-git-hosting"},{title:"Google Photos Alternative With Photoprism",_path:"\u002Flinux\u002Fgoogle-photos-alternative-with-photoprism"},{title:"Resume Or Start Screen Session",_path:"\u002Flinux\u002Fresume-or-start-screen-session"},{title:"Rsync File With SSH",_path:"\u002Flinux\u002Frsync-file-with-ssh"},{title:"Setting Up NGINX",_path:"\u002Flinux\u002Fsetting-up-nginx"},{title:"SSH",_path:"\u002Flinux\u002Fssh"}]},{title:"Obsidian",_path:"\u002Fobsidian",children:[{title:"Self Hosted Obsidian Sync With CouchDB",_path:"\u002Fobsidian\u002Fself-hosted-obsidian-sync-with-couchdb"}]},{title:"Sql",_path:"\u002Fsql",children:[{title:"MySQL And MariaDB Setup",_path:"\u002Fsql\u002Fmysql-and-mariadb-setup"},{title:"Postgress Setup",_path:"\u002Fsql\u002Fpostgress-setup"}]},{title:"Typescript",_path:"\u002Ftypescript",children:[{title:"Add Global Variable To Window",_path:"\u002Ftypescript\u002Fadd-global-variable-to-window"},{title:"Flatten Object With Periods",_path:"\u002Ftypescript\u002Fflatten-object-with-periods"},{title:"Type Guards",_path:"\u002Ftypescript\u002Ftype-guards"}]}],"content-query-9RFKZoeNNl":{_path:H,_dir:"react",_draft:u,_partial:u,_locale:"en",_empty:u,title:G,description:"If you need to cancel some request, use axios with AbortController. Previously axios used cancellation token, but now it's deprecated.",excerpt:{type:I,children:[{type:a,tag:r,props:{},children:[{type:c,value:J},{type:a,tag:K,props:{href:L,rel:[M]},children:[{type:c,value:N}]},{type:c,value:O}]},{type:a,tag:r,props:{},children:[{type:a,tag:P,props:{},children:[{type:c,value:s}]},{type:c,value:Q}]},{type:a,tag:t,props:{code:v,language:R},children:[{type:a,tag:S,props:{},children:[{type:a,tag:t,props:{__ignoreMap:w},children:[{type:c,value:v}]}]}]}]},body:{type:I,children:[{type:a,tag:r,props:{},children:[{type:c,value:J},{type:a,tag:K,props:{href:L,rel:[M]},children:[{type:c,value:N}]},{type:c,value:O}]},{type:a,tag:r,props:{},children:[{type:a,tag:P,props:{},children:[{type:c,value:s}]},{type:c,value:Q}]},{type:a,tag:t,props:{code:v,language:R},children:[{type:a,tag:S,props:{},children:[{type:a,tag:t,props:{__ignoreMap:w},children:[{type:a,tag:b,props:{class:f},children:[{type:a,tag:b,props:{class:g},children:[{type:c,value:T}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:U}]},{type:a,tag:b,props:{class:h},children:[{type:c,value:x}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:V}]},{type:a,tag:b,props:{class:h},children:[{type:c,value:W}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:" } "}]},{type:a,tag:b,props:{class:g},children:[{type:c,value:X}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:e}]},{type:a,tag:b,props:{class:y},children:[{type:c,value:"\"react\""}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:z}]}]},{type:a,tag:b,props:{class:f},children:[{type:a,tag:b,props:{class:g},children:[{type:c,value:T}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:e}]},{type:a,tag:b,props:{class:h},children:[{type:c,value:Y}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:e}]},{type:a,tag:b,props:{class:g},children:[{type:c,value:X}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:e}]},{type:a,tag:b,props:{class:y},children:[{type:c,value:"'axios'"}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:z}]}]},{type:a,tag:b,props:{class:f},children:[]},{type:a,tag:b,props:{class:f},children:[{type:a,tag:b,props:{class:i},children:[{type:c,value:m}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:e}]},{type:a,tag:b,props:{class:o},children:[{type:c,value:Z}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:e}]},{type:a,tag:b,props:{class:g},children:[{type:c,value:l}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:e}]},{type:a,tag:b,props:{class:h},children:[{type:c,value:Y}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:k}]},{type:a,tag:b,props:{class:j},children:[{type:c,value:"create"}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:A}]}]},{type:a,tag:b,props:{class:f},children:[]},{type:a,tag:b,props:{class:f},children:[{type:a,tag:b,props:{class:g},children:[{type:c,value:"export"}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:e}]},{type:a,tag:b,props:{class:i},children:[{type:c,value:m}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:e}]},{type:a,tag:b,props:{class:j},children:[{type:c,value:"useGetUsers"}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:e}]},{type:a,tag:b,props:{class:g},children:[{type:c,value:l}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:_}]},{type:a,tag:b,props:{class:i},children:[{type:c,value:B}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:C}]}]},{type:a,tag:b,props:{class:f},children:[{type:a,tag:b,props:{class:d},children:[{type:c,value:p}]},{type:a,tag:b,props:{class:i},children:[{type:c,value:m}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:e}]},{type:a,tag:b,props:{class:o},children:[{type:c,value:q}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:e}]},{type:a,tag:b,props:{class:g},children:[{type:c,value:l}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:e}]},{type:a,tag:b,props:{class:j},children:[{type:c,value:W}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:D}]},{type:a,tag:b,props:{class:g},children:[{type:c,value:$}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:e}]},{type:a,tag:b,props:{class:j},children:[{type:c,value:s}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:"());"}]}]},{type:a,tag:b,props:{class:f},children:[{type:a,tag:b,props:{class:d},children:[{type:c,value:p}]}]},{type:a,tag:b,props:{class:f},children:[{type:a,tag:b,props:{class:d},children:[{type:c,value:p}]},{type:a,tag:b,props:{class:i},children:[{type:c,value:m}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:e}]},{type:a,tag:b,props:{class:o},children:[{type:c,value:E}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:e}]},{type:a,tag:b,props:{class:g},children:[{type:c,value:l}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:e}]},{type:a,tag:b,props:{class:j},children:[{type:c,value:x}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:D}]},{type:a,tag:b,props:{class:i},children:[{type:c,value:"async"}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:_}]},{type:a,tag:b,props:{class:i},children:[{type:c,value:B}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:C}]}]},{type:a,tag:b,props:{class:f},children:[{type:a,tag:b,props:{class:d},children:[{type:c,value:n}]},{type:a,tag:b,props:{class:i},children:[{type:c,value:m}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:e}]},{type:a,tag:b,props:{class:o},children:[{type:c,value:aa}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:e}]},{type:a,tag:b,props:{class:g},children:[{type:c,value:l}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:e}]},{type:a,tag:b,props:{class:g},children:[{type:c,value:"await"}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:e}]},{type:a,tag:b,props:{class:h},children:[{type:c,value:Z}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:k}]},{type:a,tag:b,props:{class:j},children:[{type:c,value:E}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:D}]},{type:a,tag:b,props:{class:y},children:[{type:c,value:"\"\u002F\""}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:", {"}]}]},{type:a,tag:b,props:{class:f},children:[{type:a,tag:b,props:{class:d},children:[{type:c,value:" "}]},{type:a,tag:b,props:{class:ab},children:[{type:c,value:"\u002F\u002F params and props here"}]}]},{type:a,tag:b,props:{class:f},children:[{type:a,tag:b,props:{class:d},children:[{type:c,value:" signal: "}]},{type:a,tag:b,props:{class:h},children:[{type:c,value:q}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:k}]},{type:a,tag:b,props:{class:h},children:[{type:c,value:F}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:k}]},{type:a,tag:b,props:{class:h},children:[{type:c,value:"signal"}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:","}]}]},{type:a,tag:b,props:{class:f},children:[{type:a,tag:b,props:{class:d},children:[{type:c,value:" });"}]}]},{type:a,tag:b,props:{class:f},children:[]},{type:a,tag:b,props:{class:f},children:[{type:a,tag:b,props:{class:d},children:[{type:c,value:n}]},{type:a,tag:b,props:{class:g},children:[{type:c,value:ac}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:e}]},{type:a,tag:b,props:{class:h},children:[{type:c,value:aa}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:k}]},{type:a,tag:b,props:{class:h},children:[{type:c,value:"data"}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:z}]}]},{type:a,tag:b,props:{class:f},children:[{type:a,tag:b,props:{class:d},children:[{type:c,value:" }, []);"}]}]},{type:a,tag:b,props:{class:f},children:[]},{type:a,tag:b,props:{class:f},children:[{type:a,tag:b,props:{class:d},children:[{type:c,value:p}]},{type:a,tag:b,props:{class:i},children:[{type:c,value:m}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:e}]},{type:a,tag:b,props:{class:o},children:[{type:c,value:ad}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:e}]},{type:a,tag:b,props:{class:g},children:[{type:c,value:l}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:e}]},{type:a,tag:b,props:{class:j},children:[{type:c,value:x}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:"(() "}]},{type:a,tag:b,props:{class:i},children:[{type:c,value:B}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:C}]}]},{type:a,tag:b,props:{class:f},children:[{type:a,tag:b,props:{class:d},children:[{type:c,value:n}]},{type:a,tag:b,props:{class:h},children:[{type:c,value:q}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:k}]},{type:a,tag:b,props:{class:h},children:[{type:c,value:F}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:k}]},{type:a,tag:b,props:{class:j},children:[{type:c,value:"abort"}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:A}]}]},{type:a,tag:b,props:{class:f},children:[{type:a,tag:b,props:{class:d},children:[{type:c,value:n}]}]},{type:a,tag:b,props:{class:f},children:[{type:a,tag:b,props:{class:d},children:[{type:c,value:n}]},{type:a,tag:b,props:{class:ab},children:[{type:c,value:"\u002F\u002F controller should be rewritten or all requests will fail"}]}]},{type:a,tag:b,props:{class:f},children:[{type:a,tag:b,props:{class:d},children:[{type:c,value:n}]},{type:a,tag:b,props:{class:h},children:[{type:c,value:q}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:k}]},{type:a,tag:b,props:{class:h},children:[{type:c,value:F}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:e}]},{type:a,tag:b,props:{class:g},children:[{type:c,value:l}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:e}]},{type:a,tag:b,props:{class:g},children:[{type:c,value:$}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:e}]},{type:a,tag:b,props:{class:j},children:[{type:c,value:s}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:A}]}]},{type:a,tag:b,props:{class:f},children:[{type:a,tag:b,props:{class:d},children:[{type:c,value:" }, ["}]},{type:a,tag:b,props:{class:h},children:[{type:c,value:q}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:"]);"}]}]},{type:a,tag:b,props:{class:f},children:[]},{type:a,tag:b,props:{class:f},children:[{type:a,tag:b,props:{class:d},children:[{type:c,value:p}]},{type:a,tag:b,props:{class:g},children:[{type:c,value:ac}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:U}]},{type:a,tag:b,props:{class:h},children:[{type:c,value:E}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:V}]},{type:a,tag:b,props:{class:h},children:[{type:c,value:ad}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:" };"}]}]},{type:a,tag:b,props:{class:f},children:[{type:a,tag:b,props:{class:d},children:[{type:c,value:"};"}]}]}]}]}]},{type:a,tag:"style",children:[{type:c,value:".ct-141925{color:#8B949E}.ct-767216{color:#D2A8FF}.ct-0a38ba{color:#79C0FF}.ct-3f108c{color:#FF7B72}.ct-326568{color:#A5D6FF}.ct-7d5aa8{color:#C9D1D9}.ct-0622ee{color:#C9D1D9}.ct-3b09ed{color:#FF7B72}.light .ct-3b09ed{color:#859900}.light .ct-0622ee{color:#657B83}.light .ct-7d5aa8{color:#268BD2}.light .ct-326568{color:#2AA198}.light .ct-3f108c{color:#073642}.light .ct-0a38ba{color:#268BD2}.light .ct-767216{color:#268BD2}.light .ct-141925{color:#93A1A1}"}]}],toc:{title:w,searchDepth:ae,depth:ae,links:[]}},_type:"markdown",_id:"content:Frontend:React:Axios with AbortController.md",_source:"content",_file:"Frontend\u002FReact\u002FAxios with AbortController.md",_extension:"md"}},prerenderedAt:1668142355948}}("element","span","text","ct-0622ee"," ","line","ct-3b09ed","ct-7d5aa8","ct-3f108c","ct-767216",".","=","const"," ","ct-0a38ba"," ","controller","p","AbortController","code",false,"import { useCallback, useRef } from \"react\";\nimport axios from 'axios';\n\nconst client = axios.create();\n\nexport const useGetUsers = () =\u003E {\n const controller = useRef(new AbortController());\n \n const get = useCallback(async () =\u003E {\n const result = await client.get(\"\u002F\", {\n \u002F\u002F params and props here\n signal: controller.current.signal,\n });\n\n return result.data;\n }, []);\n\n const cancel = useCallback(() =\u003E {\n controller.current.abort();\n \n \u002F\u002F controller should be rewritten or all requests will fail\n controller.current = new AbortController();\n }, [controller]);\n\n return { get, cancel };\n};\n","","useCallback","ct-326568",";","();","=\u003E"," {","(","get","current","Axios With AbortController","\u002Ffrontend\u002Freact\u002Faxios-with-abortcontroller","root","If you need to cancel some request, use ","a","https:\u002F\u002Faxios-http.com\u002Fdocs\u002Fcancellation","nofollow","axios with AbortController",". Previously axios used cancellation token, but now it's deprecated.","code-inline"," can be used with a multiple requests to cancel them at once.","typescript","pre","import"," { ",", ","useRef","from","axios","client"," () ","new","result","ct-141925","return","cancel",2))