This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // The Veeva API can only accept one call at a time. | |
| // A queue is used to avoid calling the API while an earlier call is in progress. | |
| var Queue = (function () { | |
| var queue = []; | |
| var empty = true; | |
| return { | |
| // Add a function to the queue | |
| // (it will be called immediately if the queue is empty) | |
| push: function (fn) { | |
| queue.push(fn); |