O'Reilly logo

Isomorphic Go by Kamesh Balasubramanian

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Rendering the shopping cart

The renderShoppingCartItems function is responsible for conducting the last two steps of the ERDA strategy, the Decode and Attach steps. Here's the source listing of the renderShoppingCartItems function:

func renderShoppingCartItems(env *common.Env) {  productsChannel := make(chan []*models.Product)  go fetchProductsInShoppingCart(productsChannel)  products := <-productsChannel  templateData := &templatedata.ShoppingCart{PageTitle: "Shopping Cart", Products: products}  env.TemplateSet.Render("shopping_cart_content", &isokit.RenderParams{Data: templateData, Disposition: isokit.PlacementReplaceInnerContents, Element: env.PrimaryContent, PageTitle: templateData.PageTitle})  InitializeShoppingCartPage(env) env.Router.RegisterLinks("#primaryContent ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required