Eventual Consistency
const { addTodo } = require('./writeModel')
const { getById } = require('./readModel')
addTodo('123', { title: 'foobar' })
.then( () => getById({ id: '123' }))const { addTodo } = require('./writeModel')
const { getById, refresh } = require('./readModel')
addTodo('123', { title: 'foobar' })
.then(() => refresh()) // <- PULL the latest changes from the write model
.then(() => getById({ id: '123' }))Last updated
Was this helpful?