I want to make a simple application as a proof of concept for react components, and I was wondering if there was a way to implement recompose in such a way that it creates a store accesible from anywhere. This is what I have tried:
import App from './app-container'
import { withContext } from 'recompose'
import React, {
Component,
PropTypes,
} from 'react'
// Sets up application store.
const provide = store => withContext(
{ store: PropTypes.object },
() => ({ store })
)
var appStore = {
toast: null,
test: "hi"
}
const AppWithContext = provide(appStore)(App)
export default AppWithContext