| 34 | } |
| 35 | |
| 36 | export function enqueueBindingConnect(binding) { |
| 37 | if (immediate < minimumImmediate) { |
| 38 | immediate++; |
| 39 | binding.connect(false); |
| 40 | } else { |
| 41 | // get or assign the binding's id that enables tracking whether it's been queued. |
| 42 | let id = binding.__connectQueueId; |
| 43 | if (id === undefined) { |
| 44 | id = nextId; |
| 45 | nextId++; |
| 46 | binding.__connectQueueId = id; |
| 47 | } |
| 48 | // enqueue the binding. |
| 49 | if (!queued[id]) { |
| 50 | queue.push(binding); |
| 51 | queued[id] = true; |
| 52 | } |
| 53 | } |
| 54 | if (!isFlushRequested) { |
| 55 | isFlushRequested = true; |
| 56 | PLATFORM.requestAnimationFrame(flush); |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | export function setConnectQueueThreshold(value) { |
| 61 | minimumImmediate = value; |