Add the total number of tags that are waiting for validation as parameter in the 'on-tag-adding' callback
dfiori opened this issue · 0 comments
dfiori commented
When I copy-past N tags into the input, N events 'new tag added' will be generated and for each one a cals to 'on-tag-adding' callback will be fired.
It will be very usefull to know the total amount (N in this case) of tags and so the total events that will be generated.
This to achieve a single 'server request' to validate all tags one shot:
- On each callback execution I create a promise.
- Add each promise to an array
- When the array length is N, then perform a server request with the list of tags as parameter
- On response, for each tag check if valid/invalid then resolve/reject the related promise