۵۰٪ تخفیف فقط تا پایان جشنواره؛ بعدش همه‌چیز به قیمت قبل برمی‌گرده!

مشاهده دوره‌ها
ثانیه
دقیقه
ساعت
روز
راکت

مشکل با bind کردن this

بدون پاسخ

سلام به همه دوستان
من برای ی کاری اومدم از Promise.all اینطوری استفاده کردم

 await Promise.all(
            [
                signupController.signUpToEmployeeService(request)
                    .then(response => dataRollback.push(rollbackController.employeeServiceRollback))
                    .catch(err => dataErrors.push('EmployeeService error: ' + err)),
                signupController.signUpToAuthenticationService.bind(self, request)
                    .then(response => dataRollback.push(rollbackController.authenticationServiceRollback.bind(self)))
                    .catch(err => dataErrors.push('AuthenticationService error: ' + err)),
                signupController.signUpToProfileService(request).bind(self)
                    .then(response => dataRollback.push(rollbackController.ProfileServiceRollback.bind(self)))
                    .catch(err => dataErrors.push('ProfileService error: ' + err)),
                signupController.signUpToSamadService(request)
                    .then(response => dataRollback.push(rollbackController.samadServiceRollback.bind(self)))
                    .catch(err => dataErrors.push('SamadService error: ' + err)),
            ]
        );

اومدم برای فرستادن this به اون فانکشن از bind(this, request) استفاده کردم.
اما این اررور رو میده:
TypeError: signupController.signUpToAuthenticationService.bind(...).then is not a function

ثبت پرسش جدید

پاسخ‌ها

0

هنوز پاسخی ثبت نشده

اولین نفری باشید که به این پرسش کمک می‌کند و مسیر حل مشکل را باز می‌کند.

اولین پاسخ را بنویسید

شاید پاسخ شما همین‌جا باشد

برای ارسال پاسخ لازم است وارد شده یا ثبت‌نام کنید

ورود یا ثبت‌نام