Skip to content

How to access a newly created entity? #882

Closed Answered by NickSeagull
purefun asked this question in Q&A
Discussion options

You must be logged in to vote

Hey, thanks for reporting, discussing these things are super important for us to figure out the best UX 😄

Still, you should not rely on the entity itself as the source of truth, but rather on the events. You cannot access entities (well, you can with the Booster.entity function, but generally you don't want that) and rather you would access read models if you wanted to access the state of your system.

In fact, even if that TODO returned something, an entity ID wouldn't be in that response 😅

The reason is that entities are in some middle ground between the write (commands) and the read (read models) parts of the framework and are mainly used for snapshotting and relative ordering of events.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@purefun
Comment options

@NickSeagull
Comment options

Answer selected by purefun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #880 on June 28, 2021 13:32.