()
| 653 | * Only subscribes to the specific state values needed. |
| 654 | */ |
| 655 | export function useOperationQueue() { |
| 656 | const hasOperationError = useOperationQueueStore((state) => state.hasOperationError) |
| 657 | |
| 658 | const actions = useOperationQueueStore.getState() |
| 659 | |
| 660 | return { |
| 661 | get queue() { |
| 662 | return useOperationQueueStore.getState().operations |
| 663 | }, |
| 664 | get isProcessing() { |
| 665 | return useOperationQueueStore.getState().isProcessing |
| 666 | }, |
| 667 | hasOperationError, |
| 668 | addToQueue: actions.addToQueue, |
| 669 | confirmOperation: actions.confirmOperation, |
| 670 | failOperation: actions.failOperation, |
| 671 | processNextOperation: actions.processNextOperation, |
| 672 | hasPendingOperations: actions.hasPendingOperations, |
| 673 | waitForWorkflowOperations: actions.waitForWorkflowOperations, |
| 674 | cancelOperationsForBlock: actions.cancelOperationsForBlock, |
| 675 | cancelOperationsForVariable: actions.cancelOperationsForVariable, |
| 676 | triggerOfflineMode: actions.triggerOfflineMode, |
| 677 | clearError: actions.clearError, |
| 678 | } |
| 679 | } |
no outgoing calls
no test coverage detected