Skip to main content

Out-of-Band Updates

Out-of-Band (OOB) updates allow you to update multiple DOM elements from a single WebSocket response, enabling rich, multi-area updates that keep your UI in sync across different sections of your application.

What Are OOB Updates?

OOB updates let you update elements outside of the main target element specified in the client request. This is particularly useful for:
  • Updating navigation counters
  • Showing notifications
  • Refreshing status indicators
  • Updating multiple related sections
  • Maintaining consistency across the UI

Basic OOB Updates

Single OOB Update

Multiple OOB Updates

OOB Update Structure

WSXOOBUpdate Interface

Example with Different Swaps

Real-World Examples

E-commerce Cart Update

Dashboard Updates

Real-time Chat with Activity

Advanced OOB Patterns

Conditional OOB Updates

Dynamic OOB Generation

OOB with Broadcasting

OOB Update Helpers

Utility Functions

OOB Builder Pattern

Performance Considerations

Efficient OOB Updates

  • Minimize the number of OOB updates per response
  • Use specific selectors to avoid unnecessary DOM queries
  • Batch related updates when possible
  • Consider the impact on client-side performance

OOB Update Strategies

Best Practices

  1. Use Sparingly: Don’t overuse OOB updates - they can make debugging difficult
  2. Specific Selectors: Use specific CSS selectors to avoid conflicts
  3. Consistent Patterns: Establish patterns for common OOB updates
  4. Document Dependencies: Document which elements depend on which actions
  5. Error Handling: Handle cases where OOB targets don’t exist
  6. Performance: Monitor performance impact of frequent OOB updates

Next Steps