Vitthal Korvanvitthal-korvan.hashnode.devยทOct 2, 2024Callback and PromisesCallback Function Definition A callback is a function that you pass into another function as an argument. The function receiving the callback will call it (execute it) at some point in its process, either immediately, or after some event has occurred...2 likesAsynchronous JavaScriptcallback
๊ณ ๋ผ๋๋๋กkoranidro.hashnode.devยทAug 20, 2024[React] ๋น์ ์ ์ํ๋ฅผ ํ์๋ก ํ์ง ์์ ๊ฒ์ ๋๋ค. #4 - ๋น๋๊ธฐ(with. use) ํธ์ด ํฌ์คํธ๋ React ๋ฒ์ 18.3.1์ ๊ธฐ์ค์ผ๋ก ํฉ๋๋ค. ์ด๋ฒ ํธ์ ์ด์ ํธ์ผ๋ก๋ถํฐ ์ด์ด์ง๋๋ค. use์ ๊ตฌ์ฒด์ ์ธ ๋์์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค. use๋ ํธ์ถ์๋ก๋ถํฐ Promise๋ฅผ ์ ๋ฌ๋ฐ์ต๋๋ค. Promise๊ฐ ์ถ์ ์ค์ธ์ง ํ์ธํฉ๋๋ค. ์ถ์ ์ค์ด ์๋๋ผ๋ฉด ์ถ์ ์ ์์ํฉ๋๋ค. ์ถ์ ์ค์ธ Promise์ ์ํ๋ฅผ ํ์ธํฉ๋๋ค. ์ํ์ ๋ฐ๋ผ ๋ค์์ ์งํํฉ๋๋ค. ์งํ(pending) - ๋๊ธฐ Promise ๊ฐ์ฒด๋ฅผ throw ํฉ๋๋ค. Suspens...[React] ๋น์ ์ ์ํ๋ฅผ ํ์๋ก ํ์ง ์์ ๊ฒ์ ๋๋ค.React
๊ณ ๋ผ๋๋๋กkoranidro.hashnode.devยทAug 20, 2024[React] ๋น์ ์ ์ํ๋ฅผ ํ์๋ก ํ์ง ์์ ๊ฒ์ ๋๋ค. #3 - ๋น๋๊ธฐ(with. Suspense) ํธ์ด ํฌ์คํธ๋ React ๋ฒ์ 18.3.1์ ๊ธฐ์ค์ผ๋ก ํฉ๋๋ค. ํ์ ์ํ์ ์ ํ์ด Promise์ธ ๊ฒฝ์ฐ์ ์ด๋ป๊ฒ ํด์ผ ํ ๊น์? ์ํ๊น๊ฒ๋ ํด๋ผ์ด์ธํธ ์ธก์์๋ ๋น๋๊ธฐ ์ปดํฌ๋ํธ๊ฐ ์ง์๋์ง ์์ต๋๋ค. ๋ฐ๋ผ์ useState์ useEffect๋ฅผ ํจ๊ป ์ฌ์ฉํ์ฌ ์ด๋ฅผ ํด๊ฒฐํด ์์ต๋๋ค. ํ์ง๋ง Suspense์ ๋ฑ์ฅ์ผ๋ก ์ด๋ฅผ ํด๊ฒฐํ ์ ์๊ฒ ๋์์ต๋๋ค. <Suspense fallback={<div>๋ก๋ ์ค...</div>}> <Fulfilled p...40 reads[React] ๋น์ ์ ์ํ๋ฅผ ํ์๋ก ํ์ง ์์ ๊ฒ์ ๋๋ค.React
Keshav Ajavascriptasync.hashnode.devยทJul 20, 2024Asynchronous ProgramingAsynchronous Programming allows to perform tasks that takes time to execute (such as fetching data from a server or reading files) without blocking the execution of other code. Instead of waiting for a task to complete, the code moves on to other tas...JavaScript
Raj Kamblerajkamble21.hashnode.devยทJul 20, 2024Mastering JavaScript: From Sync to Async and BeyondHow JS executes the code? JavaScript execution involves two main stages: creation and execution. These stages are managed within special environments called execution contexts. 1. Creation Phase (Setting Up the Stage) Global Execution Context (GEC):...promise
Erioifpuderio.hashnode.devยทMay 29, 2024ๅ ณไบ Promise ็้่ฏ่ฟๆฎตๆถ้ด็ปๅธธ็จๅฐ้่ฏๅ่ฝ๏ผๅ ไธบไธไบ้ๆฑๅฎ็ฐ่ตทๆฅ้่ฆ้ข็น่ฎฟ้ฎๆฅๅฃ๏ผไฝ่ฟไธชๆฅๅฃไธๆฏๆไปฌ่ชๅทฑ็๏ผๆๅกๅจๅจๆตทๅค๏ผๆไปฅ่ฎฟ้ฎ่ตทๆฅๅคฑ่ดฅ็่็ผๅฏ่งๅฐ้ซ๏ผๆไปฅๆ้่ฆๅจ่ฎฟ้ฎๅคฑ่ดฅ๏ผๅ ไธบ่ฟๆฅๅๅ ๏ผๆถ่ชๅจ่ฟ่ก้่ฏใ ๆข็ถๅธธ็จ๏ผ้ฃๅฐฑๆไป่ฎฐไธๆฅ๏ผๆนไพฟไธๆฌกๆฅ้ ใ ๅฎ็ฐ ๅ ๅๅคไธไธชๅ็ fetch๏ผๅจๆ็ซ ้้ขๆไธไผ็ๅป่ฎฟ้ฎ่ฟไธชๆฅๅฃ๏ผๅฐฑๆฟๅ fetch ๆฅๅฝไพๅญ๏ผ const fetch = (url) => { return new Promise((resolve, reject) => { const r = M...2Articles1Week
Ricardo Rocha // ๐จโ๐ปbittonic.hashnode.devยทMar 11, 2024๐ Chillin' with JavaScript Promises: A Casual Chat on Async Awesomeness!Alright, let's loosen up a bit and chat about promises in JavaScript in a more casual way! ๐ฏ So, you know how JavaScript has this whole async thing going on, right? Enter promises, the cool cats that make handling asynchronous stuff a breeze. 3๏ธโฃ Th...JavaScript
Luca Del Puppoblog.delpuppo.netยทFeb 6, 2024A Promise is foreverIn the ever-evolving world of web development, mastering asynchronous operations is a crucial skill for any JavaScript developer. Asynchronous programming allows web applications to handle tasks like API requests, file operations, or any activities t...13 likesยท867 readsJavaScript
CCvava.hashnode.devยทJan 24, 2024Callbacks hells To Promise / async await rescueIn this article, I would introduce why promise was introduced? What problem wants to be solved when coding in javascript? I have learned javascript for four to five years, even used it to work for at least three years. However, I still always confuse...asynchronous
woodstockwoodstock.hashnode.devยทDec 11, 2023Promise ๊ฐ์ฒดPromise ๊ฐ์ฒด ํ๋ก๋ฏธ์ค ๊ฐ์ฒด์ ํ์์ฑ ํ๋ก๋ฏธ์ค ๊ฐ์ฒด์ ๋ํด ์ด์ผ๊ธฐ ํ๊ธฐ์ ์ ์๋ฐ์คํฌ๋ฆฝํธ์ ๋น๋๊ธฐ ์ฒ๋ฆฌ์ ๋ํด ๋ค์ ํ ๋ฒ ์ดํด๋ณด์. ์์ setTimeoutํจ์๋ฅผ ์ด์ฉํด ์์ ์ ๋น๋๊ธฐ์ ์ผ๋ก ์ฒ๋ฆฌํ์๊ณ , setTimeoutํจ์๋ ์์ฑ๋ ์ฝ๋์ ๊ฐ์ด ์ฝ๋ฐฑํจ์์ ms๋จ์์ ์ง์ฐ ์๊ฐ์ ๋งค๊ฐ๋ณ์๋ก ์ ๋ ฅ๋ฐ๋ ํจ์๋ผ๊ณ ๋ฐฐ์ ์๋ค. ์๋๋ ์ง๋์๊ฐ ์์ฑํ๋ workA, workB, workC ํจ์๋ฅผ ๋น๋๊ธฐ ํจ์๋ก ๋ค์ ์์ฑํ๊ณ , workD๋ ๋๊ธฐ์ ์ผ๋ก ...JavaScriptJavaScript