-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do i remove assert function calls #8657
Comments
You should use the first one. In production mode, this check will become Here is a great article for you How Does the Development Mode Work? |
I am using the check - process.env.development - inside assert() function and evaluate the condtion only when process.env.development is true. If i have to use that while calling assert, then everyone needs to remember to prepend assert() call with process.env.development . |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue. |
I have written an assert function which checks the "development mode" and then check the condtion and throws if the condtion is false. In the production mode, webpack removes the function body.
I would like to remove the call - assert(condition()) - scattered inside my code base in production. I am ok with an empty assert function call but the assert argument - condition() - can be an expensive function call. That's what i want to avoid.
what is the correct way to do this?
The text was updated successfully, but these errors were encountered: