به تمرین استخدامی ما خوش آمدید. در این تمرین، ما یک کتابخانه ساده ایجاد کردهایم که از React الهام گرفته شده است. هدف شما این است که قالب کد ارائهشده را تحلیل کرده و تابع useEffect
را تکمیل کنید. این تابع باید اطمینان حاصل کند که تابع داخلی آن بر اساس وابستگیهای مشخص شده در زمان اجرای برنامه به درستی اجرا میشود.
شما میتوانید کدها را در فایل task.tsx پیدا کنید.
- تحلیل فایل کد ارائهشده.
- تکمیل تابع
useEffect
درtask.tsx
. - اطمینان حاصل کنید که تابع داخلی
useEffect
بر اساس وابستگیهای مشخص شده به درستی اجرا میشود.
برای شروع پروژه، مراحل زیر را دنبال کنید:
-
مخزن را کلون کنید:
git clone https://github.com/ShahroozD/Recruitment-Task cd Recruitment-Task
-
وابستگیهای مورد نیاز را نصب کنید:
npm install
-
پکیج TypeScript را نصب کنید:
npm install -D typescript
-
دستور زیر را اجرا کنید تا کدهای شما کامپایل شود:
npm run dev
-
سرور توسعه را راهاندازی کنید:
npx serve .
Welcome to our recruitment task. In this exercise, we have created a simplified library inspired by React. Your objective is to analyze the provided code template and complete the useEffect
function. This function should ensure that its inner function executes correctly based on its dependencies when the program runs.
You can find the code template in the task.tsx file.
- Analyze the provided code template.
- Complete the
useEffect
function intask.tsx
. - Ensure that the inner function of
useEffect
executes according to the specified dependencies.
To get started with the project, follow these steps:
-
Clone the repository:
git clone https://github.com/ShahroozD/Recruitment-Task cd Recruitment-Task
-
Install the required dependencies:
npm install
-
(Optional) If you want to use TypeScript, install it as a development dependency:
npm install -D typescript
-
Start the development env:
npm run dev
-
Serve the project:
npx serve .