nested stores #286
-
Coming from Angular hierarchical services and React contexts, how do I implement a nested state architecture? UsecaseAn online board where the user can drag components on the board and recursively - meaning components inside components. Other State Management Solutions
React: <UsersProvider>
<UsersDashboard />
</UsersProvider> Angular: @Component({
…
providers: [UsesService]
})
export class AppComponent In both frameworks, hierarchical services and context can be injected into lower components in the tree by:
React function UsersDashboard() {
const usersStore = useContext(UsersContext);
// ...
} Angular @Component({})
export class UsersDashboardComponent {
constructor(private usersService: UsersService) {}
} In both frameworks, the injected service/context can be overridden by a child by:
ElfI have looked at the docs and the apps examples, but did not find something that shows how to achieve similar functionality. For now, I saw examples of singleton root states:
Thank you. Any help will be appreciated |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Is this what you're looking for? |
Beta Was this translation helpful? Give feedback.
Is this what you're looking for?
#17