-
-
Notifications
You must be signed in to change notification settings - Fork 886
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
Is there any way to reuse compiled schema #296
Comments
You should use your second code sample - that's exactly how it should be. |
I tried this code. It will overwrite codes in case of multi calls at the same time. Let suppose two calls came and before sending errors of first call second call will overwrite errors then first call will send errors of second call instead of first call ( which i have lost now). |
Can you please help me how can I clone deeply |
That's not correct. Validation is synchronous, JavaScript is single threaded. It could have only happened if you use the errors in the next execution block (in callback, nextTick, setTimeout etc.). Please see FAQ and #242 (comment) So you don't need to clone, you just need to use your second sample, it doesn't have the problem you describe. |
Thank you I got it. |
Hi
I am using AJV(latest) with express. here is current code
Is there any way to do this. Like just compile it once and use clone/copy of it on each call.
I also tried clone, cloneDeep of lodash. But now working.
Thank you.
The text was updated successfully, but these errors were encountered: