Bringing in the Book Bundle UI
Now that you have your Router implemented and protected by authentication checks, itâs time to tack on the UI components to make it work end to end. The code for this is quite similar to the UI code you developed in Chapter 8, âCreating a Beautiful User Experienceâ. And remember that you can review the b4-final application in the downloads that accompany this book, which include all of the code as well.
Open your index.ts file for editing. Youâll need a couple of methodsâthe first of which is getBundles. Add this code toward the top of the file, right after fetchJSON:
â | âconstâ getBundles = âasyncâ () => { |
â | âconstâ bundles = âawaitâ fetchJSON(â'/api/list-bundles' ... |
Get Node.js 8 the Right Way now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.