Node.js+TypeScriptã§ããã¯ã¨ã³ããæ¸ãã¦ãã¨ãDIãã¿ã¼ã³ã使ãããå ´é¢ãçµæ§ããã ããããDIã¨è¨ãã¨ã³ã³ã¹ãã©ã¯ã¿ã¤ã³ã¸ã§ã¯ã·ã§ã³ãªã©ã¯ã©ã¹ãããã®æ¹æ³ãæãæµ®ãã¶ããã©ããå®éã«ã¯é¢æ°ã§ãDIãã¿ã¼ã³ãæ¸ããã¨ãã§ãããåç´ã«é¢æ°ã®ãã©ã¡ã¼ã¿ã«ä¾åãåãåãã°ããã // ä¾åã表ç¾ããå interface Deps { appService: AppServiceInterface; } // DIãã¿ã¼ã³ãè¨è¿°ããé¢æ° function DoSomething({appService}: Deps, params: any) { ... } ä¾åãæ³¨å ¥ããå ´åã«ã¯ãå¼æ°ãé¨åé©ç¨ããbind()ã¡ã½ããã使ãã // ä¾åãæ³¨å ¥ const doSomething = DoSomething.bind(null, { appService: new MyAp
{{#tags}}- {{label}}
{{/tags}}