Reuse service address
This commit is contained in:
+1
-1
@@ -4,8 +4,8 @@ import {RootStoreModel} from './models/root-store'
|
||||
import * as libapi from './lib/api'
|
||||
import * as storage from './lib/storage'
|
||||
|
||||
export const DEFAULT_SERVICE = 'http://localhost:2583'
|
||||
const ROOT_STATE_STORAGE_KEY = 'root'
|
||||
const DEFAULT_SERVICE = 'http://localhost:2583'
|
||||
const STATE_FETCH_INTERVAL = 15e3
|
||||
|
||||
export async function setupState() {
|
||||
|
||||
@@ -74,7 +74,7 @@ export class RootStoreModel {
|
||||
}
|
||||
}
|
||||
|
||||
const throwawayInst = new RootStoreModel(AtpApi.service('http://localhost')) // this will be replaced by the loader
|
||||
const throwawayInst = new RootStoreModel(AtpApi.service('http://localhost')) // this will be replaced by the loader, we just need to supply a value at init
|
||||
const RootStoreContext = createContext<RootStoreModel>(throwawayInst)
|
||||
export const RootStoreProvider = RootStoreContext.Provider
|
||||
export const useStores = () => useContext(RootStoreContext)
|
||||
|
||||
Reference in New Issue
Block a user