Skip to Content
Practical Microservices
book

Practical Microservices

by Ethan Garofolo
April 2020
Intermediate to advanced
292 pages
6h 50m
English
Pragmatic Bookshelf
Content preview from Practical Microservices

Object Destructuring

Speaking of top-level, dependency-receiving functions, their syntax might be new to you. Continuing with the identity component, consider its top-level function:

 function​ build ({ messageStore }) {
 // body omitted
 }

The parameter list on this function has curly braces, and those smell like object literals. But you’re probably used to having to write object literals with key–value pairs separated by colons, such as: { key: ’value’ }.

ES6 introduced shorthand for extracting values out of objects and binding them to names in local scope. For example, let’s examine the identity component’s loadIdentity function:

 function​ loadIdentity (context) {
 const​ { ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Microservices in Action

Microservices in Action

Morgan Bruce, Paulo A Pereira
Microservices: Up and Running

Microservices: Up and Running

Ronnie Mitra, Irakli Nadareishvili
Kubernetes Best Practices

Kubernetes Best Practices

Brendan Burns, Eddie Villalba, Dave Strebel, Lachlan Evenson

Publisher Resources

ISBN: 9781680507782Errata Page