Messages flowing into and within the boundaries of a bus — Previously, we reached an awkward half way point. We sent our Cart messages describing events in time. import { Cart } from "./Cart.js";
const cart = Cart();
// 2 yoyos
cart(Message(AddedToCart, { …yoyo, quantity: 2 }));
// 1 skpping rope
cart(Message(AddedToCart, { …skippingRope, quantity: 1 }));
// checkout
const cartTotals = cart(Message(AtCheckout));
console.log(cartTotals.items, "items, total cost:", cartTotals.total)…