April 2020
Intermediate to advanced
292 pages
6h 50m
English
You’ve built the application that allows users to manage their video metadata, and you’ve built the Component that powers that management. Now it’s time to populate the View Data that feeds the application. It’s a pretty straightforward Aggregator. First, its top-level function:
| | function build ({ db, messageStore }) { |
| | const queries = createQueries({ db }) |
| | const handlers = createHandlers({ queries }) |
| | const subscription = messageStore.createSubscription({ |
| | streamName: 'videoPublishing', |
| | handlers, |
| | subscriberId: componentId |
| | }) |
| | |
| | function start (es) { |
| | subscription.start() |
| | } |
| | |
| | return { |
| | handlers, |
| | queries, |
| | start |
| | } |
| | } |
| | |
| | module.exports ... |
Read now
Unlock full access