d
I'm wondering: is it recommended to follow the same repository structure that Umbraco uses to communicate with the backend? I've been trying to read through the repositories, the controllers and the data sources in the Umbraco source, but it's still going a little over my head.
w
Start out simple and make it work first and then if needed follow the same patterns. For my little Examine Peek package I just make the HTTP call in the entity action. But as it’s the only thing that uses/consumes it. So there is no need for stores, repos etc imo.
r
That's what I did for the Sustainability package too. I was trying to copy Kevin's TimeDashboard example but that has contexts, repositories and stores which was confusing for me to start with, so I started at the context layer and made sure I could use
consumeContext()
with that first, then the repository layer which connected to my generated API Nathan's Workflow UI only uses a context layer (https://github.com/umbraco/Umbraco.Workflow.Client.Preview/blob/main/src/context/workflow-context.ts) and uSync uses all three (https://github.com/KevinJump/uSync/blob/v14/dev/uSync.Backoffice.Management.Client/usync-assets/src/workspace/workspace.context.ts)
w
Yep I went real slim and didn’t bother with context, repo or store. So like I say unless you start to need to reuse in other places then consider it.
d
Cool, thanks for the recommendations!