April 2020
Intermediate to advanced
292 pages
6h 50m
English
Here’s the registration action:
| | function registerUser (traceId, attributes) { |
| | const context = { attributes, traceId, messageStore, queries } |
| | |
| | return Bluebird.resolve(context) |
| | .then(validate) |
| | .then(loadExistingIdentity) |
| | .then(ensureThereWasNoExistingIdentity) |
| | .then(hashPassword) |
| | .then(writeRegisterCommand) |
| | } |
This function relies on the mechanics of Promise chains to handle control flow, so all we have to do is declare the steps this action goes through. Each of those steps is a reference to a function we required at the top of the file. We start by first declaring context. Each of those functions takes a single parameter, which will be this ...
Read now
Unlock full access