File tree Expand file tree Collapse file tree 4 files changed +29
-10
lines changed
Expand file tree Collapse file tree 4 files changed +29
-10
lines changed Original file line number Diff line number Diff line change 200200 "memoize-one" : " ^4.0.0" ,
201201 "mobx" : " ^4.0.0" ,
202202 "mobx-react" : " ^5.2.3" ,
203+ "mobx-react-lite" : " ^1.3.2" ,
203204 "mobx-state-tree" : " ^3.3.0" ,
204205 "moment" : " ^2.18.1" ,
205206 "monaco-editor-textmate" : " ^2.0.0" ,
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import {
1111} from '@codesandbox/common/lib/utils/analytics' ;
1212import '@codesandbox/common/lib/global.css' ;
1313
14+ import { Signals , Store } from 'app/store' ;
1415import history from 'app/utils/history' ;
1516import { client } from 'app/graphql/client' ;
1617import registerServiceWorker from '@codesandbox/common/lib/registerServiceWorker' ;
@@ -119,16 +120,21 @@ function boot() {
119120 } ) ;
120121
121122 try {
123+ const { signals, store } = controller . provide ( ) ;
122124 render (
123- < Provider { ...controller . provide ( ) } >
124- < ApolloProvider client = { client } >
125- < ThemeProvider theme = { theme } >
126- < Router history = { history } >
127- < App />
128- </ Router >
129- </ ThemeProvider >
130- </ ApolloProvider >
131- </ Provider > ,
125+ < Signals . Provider value = { signals } >
126+ < Store . Provider value = { store } >
127+ < Provider { ...{ signals, store } } >
128+ < ApolloProvider client = { client } >
129+ < ThemeProvider theme = { theme } >
130+ < Router history = { history } >
131+ < App />
132+ </ Router >
133+ </ ThemeProvider >
134+ </ ApolloProvider >
135+ </ Provider >
136+ </ Store . Provider >
137+ </ Signals . Provider > ,
132138 rootEl
133139 ) ;
134140 } catch ( e ) {
Original file line number Diff line number Diff line change 1- import { Module } from 'cerebral' ;
21import HttpProvider from '@cerebral/http' ;
2+ import { Module } from 'cerebral' ;
3+ import { createContext , useContext } from 'react' ;
34
45import model from './model' ;
56import ApiProvider from './providers/Api' ;
@@ -39,6 +40,12 @@ import live from './modules/live';
3940import dashboard from './modules/dashboard' ;
4041import userNotifications from './modules/user-notifications' ;
4142
43+ export const Signals = createContext ( ) ;
44+ export const Store = createContext ( ) ;
45+
46+ export const useSignals = ( ) => useContext ( Signals ) ;
47+ export const useStore = ( ) => useContext ( Store ) ;
48+
4249export default Module ( {
4350 model,
4451 state : {
Original file line number Diff line number Diff line change 1674016740 dependencies:
1674116741 minimist "0.0.8"
1674216742
16743+ mobx-react-lite@^1.3.2:
16744+ version "1.3.2"
16745+ resolved "https://registry.yarnpkg.com/mobx-react-lite/-/mobx-react-lite-1.3.2.tgz#4366048b5d283d12a82053367638b5d79281951f"
16746+ integrity sha512-D8VZEsxSxMNYDJmw2SgUXVAgpOlVYmp3hBCusoe+LuBDYUqyn2K3RPrMEF0rIzYJAvqpyv7YRrH8I3eBsPPx1A==
16747+
1674316748mobx-react@^5.2.3:
1674416749 version "5.4.3"
1674516750 resolved "https://registry.yarnpkg.com/mobx-react/-/mobx-react-5.4.3.tgz#6709b7dd89670c40e9815914ac2ca49cc02bfb47"
You can’t perform that action at this time.
0 commit comments