Closed joelhoisko closed 3 years ago
This one is still missing lots of stuff, I've been just kinda copying our structure for event handlers and making it "seemingly" fit the projections stuff we've been thinking about. No samples or building code yet.
projections
in the project.client.withProjections()
for building Projections inlineProjectionsBuilder
withcreateProjection(projectionId)
method that returns aProjectionBuilder
that has 3 methods:inScope(scopeId)
for setting the scope (defaults to default scope)forReadModel(Constructor<any>)
that takes a class to register as a readmodel for the projectionon()
with all of the variations for usingEventType
s, type arguments orGeneration
s etcforReadModel()
,on()
andinScope()
methods in whichever order.forReadModel()
beforeinScope()
or stuff like that.forReadModel()
twice I guess. This gets checked during the build and it will throw an error in that case.Samples/Tutorials/Projections
with a readmodel of all chefs and all the dishes they've preparedprojections
project builds, but the whole repo doesn't as I'm waiting for theProjectionsClient
from the new contracts for JS. I've mocked theProjectionsClient
in places with a dummy type.ProjectionResult.delete
in theon()
method.Example how the inline code would look like:
And a diagram on how the builder works: