profile
Front-End ๐Ÿ˜ฒ
post-thumbnail

Redux Saga

Redux Saga Redux์˜ ๋น„๋™๊ธฐ์ฒ˜๋ฆฌ๋ฅผ ์œ„ํ•œ ๋ฏธ๋“ค์›จ์–ด generatorํ•จ์ˆ˜ ๊ธฐ๋ฐ˜์œผ๋กœ ๋น„๋™๊ธฐ์ž‘์—…์„ ๊ด€๋ฆฌ redux-saga์˜ saga๊ฐ€ generator ํ•จ์ˆ˜๋ฅผ ์˜๋ฏธํ•œ๋‹ค. generator ํ•จ์ˆ˜์—์„œ action์— ๋”ฐ๋ฅธ ์ž‘์—…์„ yield Thunk์™€์˜ ์ฐจ์ด์  Thunk๋Š” ๋น„๋™๊ธฐ์•ก์…˜ํ•จ์ˆ˜๋ฅผ ์ง์ ‘ ํ˜ธ์ถœํ•˜๋Š” ํ˜•์‹์ด์ง€๋งŒ Saga๋Š” ์ œ๋„ˆ๋ ˆ์ดํ„ฐ ํ•จ์ˆ˜๋ฅผ ๋“ฑ๋กํ•˜์—ฌ ์ด๋ฒคํŠธ ํ•ธ๋“ค๋Ÿฌ์™€ ๊ฐ™์€ ๋Š๋‚Œ์œผ๋กœ ์ง€์ •ํ•œ ์•ก์…˜์ด ํ˜ธ์ถœ๋ ๋•Œ ๋‚š์•„์ฑˆ๋‹ค. ์žฅ์  generator ํ•จ์ˆ˜๋ฅผ ์ด์šฉํ•˜๊ธฐ ๋•Œ๋ฌธ์— ํ…Œ์ŠคํŠธํ•˜๊ธฐ ์šฉ์ดํ•˜๋‹ค. next()๋ฅผ ์ด์šฉํ•˜๋ฉด yield๋กœ ๊ตฌ๋ถ„๋˜์–ด์ง„ ์˜์—ญ์ด ๋‚˜๋ˆ ์„œ ์‹คํ–‰๋˜๊ธฐ ๋•Œ๋ฌธ ๋‹จ์  Generator๋ž€? function* ํ‚ค์›Œ๋“œ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋งŒ๋“ ๋‹ค

2021๋…„ 12์›” 11์ผ
ยท
0๊ฐœ์˜ ๋Œ“๊ธ€
ยท