The second import solution creates a tightly coupled store, which makes testing, using another store with the same interface, using different stores in different parts of the application hard.
Both solutions work. The second one is simpler but hardly coupled to the implementation. The first one is a bit more complex but makes the code more open to alteration.
This is why one must try their best to ensure that with a tightly coupled store, such stores are only used at top level components, leaving the rest to be dumb components used only to display data or emit an event
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The second
import
solution creates a tightly coupled store, which makes testing, using another store with the same interface, using different stores in different parts of the application hard.Both solutions work. The second one is simpler but hardly coupled to the implementation. The first one is a bit more complex but makes the code more open to alteration.
This is why one must try their best to ensure that with a tightly coupled store, such stores are only used at top level components, leaving the rest to be dumb components used only to display data or emit an event