@j2inn/app-react
Version:
React implementation of the j2inn-app framework
16 lines (15 loc) • 486 B
JavaScript
/*
* Copyright (c) 2025, J2 Innovations. All Rights Reserved
*/
import { createContext, useContext } from 'react';
export const AppRootStoreContext = createContext(null);
/**
* A hook used for accessing the application's root store.
*/
export function useAppRootStore() {
const store = useContext(AppRootStoreContext);
if (!store) {
throw new Error('Cannot access app root store. Ensure AppRootStoreContext is being used.');
}
return store;
}