ã³ã³ããã¹ãã®withValueã£ã¦å¤æ°ãå¼ãåãããã«ãã使ããã¦ãããã©ãããã§ä½¿ã£ã¦ããå ´æã¨ãå¶ç¶ååã被ã£ããã©ããªãã®ï¼ã¨ããã®ãæ°ã«ãªã£ã¦ããã®ã ãã©ããããªå¿é
ã¯ãªãã¦ãããããå¥ã®åãã¤ããããã®ã§è¡çªããªããã¨ãããã¨ã ã£ãã
Perlãæ¸ãã¦ãã¨ãScope::Containerã«ãå¼ãåãã®ãããã©ããªå¤ãå
¥ããããããã©ããã£ã¡ã¯ååãåããªãåãå¤ãåãåºãã¦ãã¾ããååãåãã§ãidãè¡çªããªããã管çãã¦ãããä»çµã¿ããã£ãã便å©ãªæ°ãããã
contextã£ã¦Reactã«ããã£ã¦ã親ããåã«ãã¼ã¿ãä¸è¶³é£ã³ã«æ¸¡ãã®ã«ä½¿ã£ãããããã©ãcontextã¨ããååã®æ¦å¿µãç»å ´ããæ©ä¼ãå¢ãã¦ãããããªæ°ãããã
useContextããã¨ãã«ã¯ãcontextã®ä¸èº«ã¯ãã£ãã¨æ¸¡ãã¦ããããããªãã¦ããã¡ã¤ã«ã®ä¸ã®æ¹ã§å®ç¾©ããã¨ããã©ããã§exportãã¦ããã¦importãã¦ä½¿ããã¨ããã°ãã¼ãã«å¤æ°ã®ãããªä½¿ãæ¹ãªã®ã§ã渡ãæ¹ã¯éãã
ã´ã«ã¼ãã³ã®ç« ã¾ã§èªãã§ã¿ããã並åã«æå®ããURLããã¦ã³ãã¼ããã¦ã¾ããã¹ã¯ãªãããªã©ãæ¸ããããã«ãªã£ã¦ãå½¹ç«ã¤ã¹ãã¼ããæ©ãã£ãã
WaitGroupã¨ãã£ã³ãã«ã使ã£ã¦æ¸ãã¦ããã並åæ°ãçµããããªããErrGroupã«ã¯SetLimitãããã®ã§ç°¡åã«æ¸ãã¾ãããã£ã¦ååããæãã¦ããããã
ãããªä¾¿å©ã¡ã½ããããããªãWaitGroupã«ã足ãã¦ããããè¯ãã®ã«ã並åæ°ãçµããããªãErrGroupãã¨ããã®ã¯ãã¨ã©ã¼ã£ã¦ååã«ã¤ãã¦ããããªããå¤ãããªãï¼ã¨æããã©ãWaitGroupã¯æ¨æºã©ã¤ãã©ãªãªã®ã§æ°è»½ã«APIã足ããªããErrGroupã¯æ¡å¼µã©ã¤ãã©ãªãªã®ã§æ°è»½ã«è¶³ãããã¨ããéããããã®ãããããªãã