-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
arbor-reactIssues specific to the @arborjs/react packageIssues specific to the @arborjs/react package
Description
In some cases it may be convenient to be able to share a store via context provider while keeping the rest of the application decoupled from how and where the store comes from:
const store1 = new Arbor<Todo[]>([])
const store2 = new Arbor<Todo[]>([])
function App1() {
return (
<Provider value={store1}>
<MyApp />
</Provider>
)
}
function App2() {
return (
<Provider value={store2}>
<MyApp />
</Provider>
)
}
function MyApp() {
const todos = useArborContext<Todo[]>()
...
}Metadata
Metadata
Assignees
Labels
arbor-reactIssues specific to the @arborjs/react packageIssues specific to the @arborjs/react package