??
???? ?? ??? ??? ??? ??? ???? ???? ?? ??? ??? ???? ? ?????. ??? ???????? ?? ?? ??? ?? ??? ???? ???? ??? ????? ???? ?? ??? ????. ? ?????? ??? ????? ????? ???? ??? ??? ?? Axios, ??? ??(useApi) ? ??? ??? ???? ???? React?? ???, ?? ?? ? ?? ??? ?? ?? ???? ???? ??? ?????.
Hook: ?? ??? ?? ??? ??? ??
????? ???? ???? ??? ??? ???. ?? ?? ??? ??? API?? ???? ???? ? ?? ??? ???? ??, ?? ??, ??? ??? ?? ? ??? ??? ??? ? ????. ?? ??? ?? ?? ???? ??? ???? ?? ???? ?? ??? ????? ???? ???? ?? ???? ?? ???. ???? ??? ??? ??? ???? ?? ? ????? ??? ???? ? ????? ? ?????? ??? ??????.
???? ?? ??? ??? ???.
- Axios ????? ???? ?? ??? ?? ??? ???? ??
- API ?? ??? ???? ?? ??? ?? useApi ??? ??
- ??? ??? ???? API ??? ??? ?? ??
- ??? ??, ?? ?? ? ??? ???? ?? ??? ?? ?? ?????.
??
- ? ?? ??? ?? ??? ??????
- ?? ??
- ????? ???? Axios ???? ??
- ??? Api Hook ???
- ????? ?? ??? ??
- ??? ?? ??
- ?: ??? ???
-
?? ?? ??(?? ??)
- ??? ?? ?? ?? ??
- ??? ????
- ?? ??
- ???? ??? ?? ?? ??
- ? ??
- ??? ??
- ?? ??: ?? ??
- ?? ??
- ?? ??
- ????
- ????
- ??
- ?? ??
? ?? ??? ?? ?????
?? ??? ?? ??? ? ?? ???? ??? ?????.
???? ?? ??
- ??: ?? ????? ??? ?? ??? ?? try-catch ??? ?????.
- ??: ??? ?? ?? ?? ? ?? ??? ?????.
???? ?? ??? ??
- ??: ?? ???? ?? ??? ?? ??? ?? ? ????.
- ??: ??? ??? ??? ??? ????? ??? ? ? ????.
Axios ????, ??? ?? ??(useApi) ? ??? ??? ?? ?? ??? ?? ??? ???? ??? ?? ??? ??? ??? ? ????.
- ?? ?? ?? ? ???? ?? ?? ??: ???? ????? ?? ??? ??? ? ?? ??? ??? ?????.
- ?? ?? ??: ?? ??? ??? ?? ? ??? ?? ???? ??? ? ??? ?? ?? ??? ?? ??? ??? ????.
?? ??
????? ???? Axios ???? ??
Axios ????? Axios? ?? ?? ?? ??? ?? ???? ?????. ?? ????? ???? ????? ??? ????, ??? ?? ????, ?? ??? ?? ???? ????? ?????? ?? ??? ??? ? ????.
1??: ??? ?? ????
// utils/axiosInstance.js import axios from 'axios'; import ERROR_MESSAGES from '../config/customErrors'; import { toast } from 'react-toastify'; import Router from 'next/router';
2??: Axios ???? ??
const axiosInstance = axios.create({ baseURL: process.env.NEXT_PUBLIC_API_BASE_URL || '', headers: { 'Content-Type': 'application/json', }, });
3??: ?? ???? ??
axiosInstance.interceptors.response.use( (response) => response, // Pass through successful responses (error) => { if (!error.response) { toast.error(ERROR_MESSAGES.NETWORK_ERROR); return Promise.reject(error); } const { status, data } = error.response; let message = ERROR_MESSAGES[status] || ERROR_MESSAGES.GENERIC_ERROR; // Custom logic for specific error types if (data?.type === 'validation') { message = `Validation Error: ${data.message}`; } else if (data?.type === 'authentication') { message = `Authentication Error: ${data.message}`; } // Display error notification toast.error(message); // Handle unauthorized access by redirecting to login if (status === 401) { Router.push('/login'); } return Promise.reject(error); } );
??:
- ?? ?? ??: ????? ??? ??? ??? ?????. ??? ?? ?? ???? ??? ???? ?? ???? ?????.
- ??? ?? ?? ???: ???? ???? ?? ??? ?? ??? ?? ?? ???? ????? ?????. ??? ? ?? ???? ??? ?? ??? ???? ?????.
- ??? ???: React-toastify? ???? ??? ??? ???? ???? ???? ???? ??? ??? ?????.
- ????: 401 Unauthorized ??? ??? ?? ???? ??? ???? ?????? ?? ???? ???? ??? ?????.
4??: Axios ???? ????
export default axiosInstance;
??? ?? ?? ???
???? ?? ???? ????? ??? ?? ??? ??? ?? ?? ???? ?????.
// config/customErrors.js const ERROR_MESSAGES = { NETWORK_ERROR: "Network error. Please check your connection and try again.", BAD_REQUEST: "There was an issue with your request. Please check and try again.", UNAUTHORIZED: "You are not authorized to perform this action. Please log in.", FORBIDDEN: "Access denied. You don't have permission to view this resource.", NOT_FOUND: "The requested resource was not found.", GENERIC_ERROR: "Something went wrong. Please try again later.", // You can add more messages here if you want }; export default ERROR_MESSAGES;
?? ??: Axios ???? ??
Axios ???? ??? ??? ?????.
- ?? ??? ?? ?? ??: ??? ? ??? ???? ?? API ??? ?? ???? ?????.
- ??? ???: React-toastify? ???? ??? ?? ????? ?? ????.
- ???? ? ??: ??? ? ???? ?? ???? ?????? ?????? ?? ???? ?????.
? ?? ??? Axios ????? ?? API ??? ??? ??? ?????? ??? ?? ??? ???? ????? ??? ???? API ?? ??? ???? ? ?????.
??? ?? useApi ?? ??
useApi ??? API ?? ??, ??, ??? ? ?? ?? ??? ?? ??????. useApi? ? ????? ??????? ????? ???? try-catch ??? ??? ??? ??? ??? ? ??? ???.
????:
- apiFunc(??): ????? ??? ???? ??? API ?????.
- immediate(??, ?? ??): ?? ??? ? ?? API ??? ???? ??? ??? ?????. ???? false???.
??? ?:
- data: API ??? ?? ???
- loading: API ??? ?? ??? ??? ?????.
- ??: ??? API ??? ?? ?? ???? ?????.
- ??: API ??? ???? ???, ??? ????? ??? ? ????.
??:
// utils/axiosInstance.js import axios from 'axios'; import ERROR_MESSAGES from '../config/customErrors'; import { toast } from 'react-toastify'; import Router from 'next/router';
??:
-
?? ??:
- data: ?? ???? ?????.
- loading: API ??? ?? ??? ?????.
- ??: ?? ???? ?????.
-
?? ??:
- API ??? ?????.
- API ?? ??? ?? ?? ????? ?????.
??? ?? ?? ????
? ??? ???? ?? JavaScript? ??? ?? ??? ???? ?? ?????. JavaScript? API ??? ?? ??? ??? ???? ? ???? ??? ?? ?????.
- Promise: Promise? ??? ??? ?? ?? ?? ??? ???? ?????. ??? ??(??) ?? ??(??)? ???? ?? ??? ??? ? ????.
- Promise Rejection: ??? ???? Promise? "??"?? .catch ??? ?? .then? ? ?? ????? ??????.
Axios ? useApi? ???:
- Axios ? Promises: Axios? Promises? ???? HTTP ??? ?????. Axios? ???? ???? ?? ???? ????? ??? ?? ???? Promise? ?????.
- Axios ????? Promise ??: Axios ?????? ??? ???? ????? Promise.reject(error)? ???? Promise? ?????. ? ??? API ??? ???? ??? ?????.
- useApi?? ?? ??: useApi ??? ?? ??? try-catch? ???? ??? ??? ?????. apiFunc(...args)? ???? catch ??? ??? ???? ?? ?? ?? ??? ???????.
?? ?? ??? ???:
- ???? ?? ?? ??: Promise ??? ???? ??? ??? ?? ??? ???? ???? ???? ? ????.
- ???? ?? ??: Promise ?? ??? ?? ??????? ?? ??? ???? ????? ???? ?? ???? ??? ??? ??????.
useApi Hook? ???? ??? ??? ????
useApi ??? ??? API ??? ???? ?? ?? ??? try-catch ??? ???? ???. ? ?? ??? ??? ?? ??? ?????.
- ?? ??: ? ?? ??? ??? ?? ?? ??? ???? ?? ???? ?????.
- ???? ?? ?? ??: ?? ???? ??? ??? ???? ???? ?? ??? ??? ??? ? ????.
- ?? ?? ?? ??: ?? ?? ??? ??????? ?? ?? ??? ???? ??? ?? ??? ???????.
useApi ??? ???? ???? ?? ?? ??? ????? ? ???? ?? ???? ?? ??? ?? ? ????.
?? ?:
// utils/axiosInstance.js import axios from 'axios'; import ERROR_MESSAGES from '../config/customErrors'; import { toast } from 'react-toastify'; import Router from 'next/router';
? ??? useApi ??? ??? ???? ?? API ??? ?????. ?? ??? ???? ??? ???? ???? ?? ??? ???? ?? ??? ?????.
??? ?? ??
??? ??? ??(?: ???, ??)?? ??? API ????? ??? ?????. ? ??? API ??? ?? ?? ??? ???? ??? ? ???? ?????.
?: ?? ???
// utils/axiosInstance.js import axios from 'axios'; import ERROR_MESSAGES from '../config/customErrors'; import { toast } from 'react-toastify'; import Router from 'next/router';
?: ??? ???
const axiosInstance = axios.create({ baseURL: process.env.NEXT_PUBLIC_API_BASE_URL || '', headers: { 'Content-Type': 'application/json', }, });
??? ??? ??:
- ??? ? ??? ???: API ??? ?? ?? ???? ???? ? ?? ?? ??? ?????.
- ?? ?? ??: API ??? ???? ???? ?? ??? ???? ???? ?? ?? ? ?? ???? ?????.
- ? ??? ???: ??? ??? ????? ????? ?? ??? ???? ?? API ?? ??? ???? ????? ??? ? ????.
?? ?? ??(?? ??)
?? ?? ???? ?? ?????? ?? ??? ?? ?? ?? ??? ??? ???.
??? ?? ?? ?? ? ??? ??????.
??? ????(?: ???? ? ??) ?? ??? ???? ???? ???? ??? ??? ?? ??? ???? ? ??? ???.
??:
axiosInstance.interceptors.response.use( (response) => response, // Pass through successful responses (error) => { if (!error.response) { toast.error(ERROR_MESSAGES.NETWORK_ERROR); return Promise.reject(error); } const { status, data } = error.response; let message = ERROR_MESSAGES[status] || ERROR_MESSAGES.GENERIC_ERROR; // Custom logic for specific error types if (data?.type === 'validation') { message = `Validation Error: ${data.message}`; } else if (data?.type === 'authentication') { message = `Authentication Error: ${data.message}`; } // Display error notification toast.error(message); // Handle unauthorized access by redirecting to login if (status === 401) { Router.push('/login'); } return Promise.reject(error); } );
??:
- ?? ??: ????? ?? ??? ?? ??? ???? ??? ??(?: ??? ?? ?? ??)? ?????.
- ?? ??? ???: ????? ?? ??? ?? ???? ?? ???? ???? ???? ??? ??? ?? ??? ??????.
??? ????
UI? ??? ???? ?? ???? ?? ?? ??? ? ??? ??? ?? ??? ??? ???? ???? ????.
??:
export default axiosInstance;
??:
- ???: ?? ??? ??? ???? ??? ??? ?? 3??? ?????? Axios? ?????.
- ??? ??: ???? ??, ??? ?? ?? ??? 500 ?? ?? ??? ???? ?? ???? ?????.
- ??? ??: ? ??? ??? ???? ?? ??? ? ????? ??? ? ????.
?? ??
???? ??? ???? ??? ? ??? ???(??, ??, ??)?? ??? ??????.
??:
// config/customErrors.js const ERROR_MESSAGES = { NETWORK_ERROR: "Network error. Please check your connection and try again.", BAD_REQUEST: "There was an issue with your request. Please check and try again.", UNAUTHORIZED: "You are not authorized to perform this action. Please log in.", FORBIDDEN: "Access denied. You don't have permission to view this resource.", NOT_FOUND: "The requested resource was not found.", GENERIC_ERROR: "Something went wrong. Please try again later.", // You can add more messages here if you want }; export default ERROR_MESSAGES;
??:
- ?? ??: ?? ????? ?? ??? ?? ??(??, ??, ??)? ?????.
- ??? ???: ????? ??? ???? ???? ??? ???? ??? ???? ? ??? ???.
???? ??? ?? ?? ??
?? ??? ??? ???? ?? ?? ??? ???? ??? ??? ????? Axios ?? ??? ?????.
??:
// utils/axiosInstance.js import axios from 'axios'; import ERROR_MESSAGES from '../config/customErrors'; import { toast } from 'react-toastify'; import Router from 'next/router';
??:
- ?? ??: ? ??? ????? ?? ??? ??? ??? ? Axios ?? ??? ???? ?? ?? API ??? ?????.
- ??? ?? ??: ??? ??? ?? ???? ?? ????? ???? ??? ?? ???? ??? ??? ?????.
- ??? ?? ??: ??? ???? ??? ??? ?????.
?? ?? ?? ??
??? ?? ??? ???? ?? ?? ???? ? ?? ? ??? ? ????.
- ?? ?? ?? ??? ??: ????? ?? ???? ?? ???? ???? ???? ??? ?? ???? ??? ? ??? ????.
- ??? ????: ?? ??? ??? ? ?? ?? ???? ??? ?????? ???? ???? ?????.
- ?? ??: ?? ??? ???? ???? ?? ??? ???? ????? ? ?? ??? ?????.
- ???? ??? ?? ?? ??: ??? ?? ? ?? ??? ???? ????? ???? ? ??? ?????.
??? ?? ??? ?? ????? ?? ?? ?? ?? ??? ??, ??? ? ??? ?? ?? ??? ????? ?? ??? ????.
??? ????
????? useApi? ?? API ??? ???? ?? ??? ??????.
?? ?? ?? ??? ??:
? ??? ??(?: userService, productService)? ?? API ?????? ?? ??? ???? ??? axiosInstance? ?????. ?? ??? ??? ??? ???? ?? ?????.
useApi? ??? ??? ?? Axios? ??????.
????? useApi? ??? ??(?: productService.getProducts)? ?????. ??? ???? useApi? ??? ???? ??? ?? axiosInstance? ?? HTTP ??? ?????.
Axios ????? ??? ?? ?? ?? ??:
axiosInstance? ????? ?? ??? ???? ?? ??? ??? ?? ?? ???? ?? ???? ?? ??? ?? ??????.
useApi? ???? ??:
useApi? ???? ??(???, ?? ? ??)? ?? ??? ????? ??? ?? ? ?? ?? ???? ??? ? ????.
??? ??
?? ????? ?? API ???? ??? ????? ?? ?? ???? ? ?? ??? ?????? ??? ?? ???? ??? ?????.
-
????
- ?? ??? API ?? ??, ?? ??, ?? ??? ???? ????? useApi ??? ???? API ??? ?????.
-
Api Hook ??
- useApi? (??? ????) API ??? ?? ??? ???? ??? ?? ?????. ??? ?? ??? ????, ??? ????, ???? ??(???, ??, ??)? ?? ??? ?? ?????.
-
??? ??
- ??? ??? ? API ?????(?: getProducts, createProduct)? ?? ?? ??? ???? ?? ??? ???? ?? ??? axiosInstance? ???? ?????? ???? ???? ?????.
-
Axios ????
- axiosInstance? ?? URL ? ??? ?? ??? ?? ??? ???? HTTP ?? ? ??? ?????.
-
API ??
- API? ??? ????? ??? ???? Axios ????? ?? ?????. ???? ??? ?? ?? ??? ?? ?? ? ??? ?? ???? ?????.
-
?? ?? ? ??? ??
- ????? ??-toastify ??? ?? ????? ?? ???? ????, ?? ?? ? ???? ??? ???? ?????? ?? ?? ??? ??? ? ????.
? ??? ???? ?? ??? ?? ??? ??? ??? ???? ?? ?? ??? ???? ?? ?? ??? ??? ?? ?? ??? ???? ??? ? ????.
?? ?? ??? ??: ?? ??
ProductList ?? ??
? ???? ?? ??? ?? ?? ? ???? ?? API ???? ??? ???? ?? ??? ?????.
// utils/axiosInstance.js import axios from 'axios'; import ERROR_MESSAGES from '../config/customErrors'; import { toast } from 'react-toastify'; import Router from 'next/router';
?? ?? ??:
-
?? ???:
- React-toastify: ??? ??? ???? ? ?????.
- productService : ??? ??? API ??? ?? ????.
- useApi: API ?? ??? ?? ??? ?? ??
-
?? ???:
- productService? getProducts ??? ???? useApi ??? ??????. false ????? ?? ??? ? API ??? ?? ???? ??? ?? ?????.
-
API ?? ???:
- useEffect? ???? ?? ??? ???? ? ?? ??? ???? ??? ? ?? ???? ?????.
-
?? ??:
- ? ?? useEffect? ?? ??? ??? ?????. ??? ???? ??? ??? ????? ????? ????.
-
??? ???:
- ?? ??: API ??? ???? ?? ?? ???? ?????.
- ?? ??: API ??? ??? ?? ?? ???? ?????.
- ??? ???: ???? ????? ???? ???, ?? ? ??? ??? ?? ???? ??????.
? ???? ?? ??? ?? ??? ?? ?? ??? ????? ??? ??? ???? ???? ??? ?????.
?? ??
?? ??? ???? ?? ?? ???? ????? ?? ??? ???? ??? ????? ???.
????? ??
- ??: ??? ??? ???? API ??? UI ?? ??? ??? ?????. ?? ?? ?? ??? ?? ???? ?????.
- ?: ?? ?? ??? ?? API ??? ???? ?? productService.js? ?? ??? ??? ?????.
??? ?? ???
- ??: ?? ??? ???? ???? ???? ????? ??? ??? ??? ?????.
- ?: customErrors.js? ?? ??? ?? ???? ???? ??? ??? ??? ???? ???? ??? ???? ?? ? ????.
???? ?? ???
- ??: ?? ??? ?? ?? ? ??? ?? ??? ???? ?? ?? ???? ???? try-catch ??? ?????.
- ?: useApi ??? ?? ??? ??? ???? ?? ??? ??? ????? ??? ? ??? ???.
?? ?? ?? ???
- ??: ??? ????? ?? ??? ?? ???? ???? ???? ??? ???? ????.
- ?: "??? ??????."? ?? ???? ???? ???? ?? "?? ??: ??? ??? ??? ?????."? ?? ?? ???? ?????.
?? ??? ??
- ??: ???? ??, ?? ?? ? ??? ?? ??? ???? ???? ?????? ??? ?????.
- ?: Axios ????? "???? ??" ???? ???? ?????? ??? ???? ???? ??? ?????.
??? ?? ??
- ??: ?? ???? ??? ??? ???? ??? ???. ??? ??? ??? ???? ????? ??? ???? ???? ?????.
- ?: ???? Sentry? ?? ?? ???? ??? ?? ??? ??? ?? ????? ???? ?? ???? ?????.
?? ??
?? ???? ?? ? ????? ??? ??? ?? ??? ????.
- Axios ???? ??: Axios ????? ???? ??? ??? ????? ???? ??? ?????.
- React Hooks ??: ?? ? ??? ??? ?? React Hooks? ?? ??? ?????.
- Redux Toolkit ??: React ??????? ???? ?? ??? ?? Redux Toolkit? ?????.
- React-Toastify ??: ? ?? ??? ???? ?? ??? ??? ???? ??? ?????.
?? ??
1. ??? ??? ???? ??
-
??:
React-toastify? ?? ??? ??????? ????? ? ????. -
???:
?? ?????? ?? ??(????? ???/_app.js)? ???? ????.
// utils/axiosInstance.js import axios from 'axios'; import ERROR_MESSAGES from '../config/customErrors'; import { toast } from 'react-toastify'; import Router from 'next/router';
2. ????? ???? ??? API ??
- ??: ??? ??? ?? ??? axiosInstance ?? ?? Axios ?????? ??? ? ????.
- ???: ?? ??? ??? ?? ??? axiosInstance? ????? ?????.
const axiosInstance = axios.create({ baseURL: process.env.NEXT_PUBLIC_API_BASE_URL || '', headers: { 'Content-Type': 'application/json', }, });
3. ?? ??? ?? ????? ???? ??
- ??: next/router? ???? ??? ???? ??? React ?? ?? ???? ???? ?? ? ????.
- ???: ???? ????? ??? ? ?? ?????? Axios ????? ????? ?????. ?? useApi ?? ?? ?? ?? ??? ????? ?????.
?? ??
??? ??? ???? ??, ???, ?? ?? ??????? ??? API ?????? ?? ??? ? ????.
1??: ?? ?? ??
????? ?? ????? .env.local ??? ???? API ?? URL? ?????.
axiosInstance.interceptors.response.use( (response) => response, // Pass through successful responses (error) => { if (!error.response) { toast.error(ERROR_MESSAGES.NETWORK_ERROR); return Promise.reject(error); } const { status, data } = error.response; let message = ERROR_MESSAGES[status] || ERROR_MESSAGES.GENERIC_ERROR; // Custom logic for specific error types if (data?.type === 'validation') { message = `Validation Error: ${data.message}`; } else if (data?.type === 'authentication') { message = `Authentication Error: ${data.message}`; } // Display error notification toast.error(message); // Handle unauthorized access by redirecting to login if (status === 401) { Router.push('/login'); } return Promise.reject(error); } );
2??: ???? ?? ??? ???
Axios ????? ?? ??? ????? ?????.
// utils/axiosInstance.js import axios from 'axios'; import ERROR_MESSAGES from '../config/customErrors'; import { toast } from 'react-toastify'; import Router from 'next/router';
?? ??:
- ??? ?? ??: .env.local ???? ??? ?? ??? ?? ?? ???? ???? ???. ??? ??? ????? .gitignore? ?????.
- ???? ?? ??: ?? ??? ?? ???? ??? ??? ?????. ????? ?????? ????? ?? ???? ?? NEXT_PUBLIC_ ???? ????.
- ? ??? ?? ?? ??: ??? ????? ????? ??? ??(?: .env.development, .env.production)? ?? ??? .env ??? ???????.
??
?? ??? ?? ?? ???? ?????? ??? ??? ??? ???? ?? ????? ???? ????? ??? ???? ??? ??????. ?? ? ????? ?? ?? ??? ????? ?? ? ?? ??? ??????? ?? ??? ? ?? ??? ??? ?????.
???? ???? ????? ?? ??? ??? ????? ??? ??? ??? ?? ??? ??? ????. ?? ??? ?? ?? ??? ?? ??? ??????? ???? ?? ??? ??? ??? ???? ?????.
?? ??
?? ??? ?? ??? ?? React/Next.js ??????? ??? ??? ?????
? ??? ??, ??? ??? ??, ??? ?? ?? ??? ????? ? ???? ??? ??? ?????.
???? ?????
???? ?? ??, ??, ??? ???? ??? ???? GitHub ? Twitter? ???? ????? ?????.
? ?? ??? ?????
?? ?? ??? ?? ?? ???? ???? npm ???? ???? ????. ????? ?? ??? ???? ????? ???? ??? ??? ????!
??? ?????! ??
? ??? Axios ? ??? ?? ??? ???? ??? ????? ?? ?? ??? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

JavaScript? ??? ?? ????? ??? ?? ??? ??? ?? ?? ?? ????? ?? ???? ???? ?????. ??? ?? ???? ?? ??? ?? ??? ???? ???? ?? ?? ???? ???? ?????. ?? ??, ??? ? ?? ???? ??? (? : ??? null? ??) ?? ??? ????? ??????. ??? ??? ???? ??? ??? ????. closure?? ?? ??? ?? ??; ? ??? ??? ?? ?? ???? ?? ???? ????. V8 ??? ?? ???, ?? ??, ??/?? ???? ?? ??? ?? ??? ??? ????? ?? ??? ?? ??? ????. ?? ?? ???? ??? ??? ??? ??? ???? ????? ?? ?? ???? ?? ???????.

Node.js?? HTTP ??? ???? ? ?? ???? ??? ????. 1. ?? ????? ????? ??? ??? ? ?? ????? ?? ?? ? https.get () ??? ?? ??? ??? ? ?? ????? ?? ??? ?????. 2.axios? ??? ???? ? ?? ??????. ??? ??? ??? ??? ??? ??? ???/???, ?? JSON ??, ???? ?? ?????. ??? ?? ??? ????? ?? ????. 3. ?? ??? ??? ??? ??? ???? ???? ??? ??? ???? ?????.

JavaScript ??? ??? ?? ?? ? ?? ???? ????. ?? ???? ???, ??, ??, ?, ???? ?? ? ??? ?????. ?? ????? ?? ?? ? ? ??? ????? ?? ??? ??? ????. ??, ?? ? ??? ?? ?? ??? ??? ??? ???? ??? ??? ???? ??? ?? ??? ????. ?? ? ????? ??? ???? ? ??? ? ??? TypeofNull? ??? ?????? ??? ? ????. ? ? ?? ??? ???? ?????? ????? ???? ??? ???? ? ??? ? ? ????.

?????, JavaScript ???! ?? ? JavaScript ??? ?? ?? ?????! ?? ?? ??? ??? ??? ? ????. Deno?? Oracle? ?? ??, ??? JavaScript ?? ??? ????, Google Chrome ???? ? ??? ??? ???? ?????. ?????! Deno Oracle? "JavaScript"??? ????? Oracle? ?? ??? ??? ??????. Node.js? Deno? ??? ? Ryan Dahl? ??? ?????? ???? ????? JavaScript? ??? ???? Oracle? ????? ???? ?????.

?? JavaScript ??? ??? ??? ?????? ?? ??? ?? ?? ??? ?? ???? ????. 1. ??? ???? ???? ?? ??? ?? ? ? ???? ??? ??? ?? ? ?? ????? ?????. 2. Angular? ?????? ??? ?? ???? ? ?? ?? ??? ??? ??? ???? ?????. 3. VUE? ???? ?? ??? ???? ?? ?? ??? ?????. ?? ?? ?? ??, ? ??, ???? ???? ? SSR? ???? ??? ??? ??? ???? ? ??? ?????. ???, ??? ??? ??? ????? ????. ??? ??? ??? ??? ?? ????.

iife (?? invokedfunctionexpression)? ?? ??? ???? ?? ????? ??? ???? ?? ??? ????? ?? ??? ? ?????. ??? ?? ?? ??? ???? ? ?? ??? ??? ?? (function () {/code/}) ();. ?? ???? ??? ?????. 1. ?? ??? ??? ?? ???? ?? ??? ??? ?????. 2. ?? ??? ??? ???? ?? ?? ??? ????. 3. ?? ?? ??? ????? ?? ???? ???????? ?? ? ??. ???? ?? ???? ?? ??? ES6 ??? ??? ??? ?? ? ??? ????? ??? ? ???? ???????.

??? JavaScript?? ??? ??? ?????? ?? ???????. ?? ??, ?? ?? ? ??? ??? ?? ????? ????? ?????. 1. ?? ??? ??? ????? ???? ??. ()? ?? ??? ??? ?????. ?. ()? ?? ??? ?? ??? ??? ?? ? ? ????. 2. ?? ??? .catch ()? ???? ?? ??? ??? ?? ??? ??????, ??? ???? ???? ????? ??? ? ????. 3. Promise.all ()? ?? ????? (?? ?? ?? ? ??????? ??), Promise.Race () (? ?? ??? ?? ?) ? Promise.AllSettled () (?? ??? ???? ??)

Cacheapi? ?????? ?? ???? ??? ???? ???, ?? ??? ??? ?? ???? ? ??? ?? ? ???? ??? ??????. 1. ???? ????, ??? ??, ?? ?? ?? ???? ???? ??? ? ????. 2. ??? ?? ?? ??? ?? ? ? ????. 3. ?? ?? ?? ?? ?? ??? ??? ?? ?????. 4. ??? ???? ?? ?? ???? ?? ?? ?? ?? ?? ???? ?? ?? ??? ??? ? ????. 5. ?? ???? ??, ??? ??? ? ??? ??, ?? ??? ? ?? ???? ???? ???? ? ?? ?????. 6.?? ??? ?? ?? ?? ??, ???? ?? ? HTTP ?? ????? ?????? ???????.
