I’ve got a simple REPL example for a simple list-detail editor. It’s made up of three components:
Annotation
is the detailAnnotations
loops through the data and createsAnnotation
instancesApp
is the top-level that creates theAnnotations
I’ve figured out how to wire up a custom Svelte store to manage the Array
of instance data for the Annotations
. I can use this by importing the store directly into the Annotations
component and calling it without any props from the top-level App
component. However, I’d like to be able to pass the store in as a property on the Annotations
component from the App
parent, i.e. <Annotations items={store}/>
, not <Annotations/>
.
Is this possible? I would think that injecting the store from a parent component would be more flexible/testable than importing it from the component itself. Have I done too much dependency injection with Spring in Java and I’m thinking about the Svelte model incorrectly?