Update Shopping Carts in Real-time

Learn how to update shopping carts in real-time.

Updating the cart

We’ll hook into two different functions to update the tracked cart:

  1. When the Channel broadcasts its cart.
  2. When it receives a broadcast that the cart contents have changed.

Add the highlighted send/2 function calls in the existing ShoppingCartChannel functions.

Get hands-on with 1200+ tech skills courses.