UNPKG

@j2inn/app-react

Version:

React implementation of the j2inn-app framework

18 lines (17 loc) 452 B
/* * Copyright (c) 2025, J2 Innovations. All Rights Reserved */ import { createContext, useContext } from 'react'; export const AppStoreContext = createContext(undefined); /** * A hook used to access an application's store. * * @returns The app store. */ export function useAppStore() { const store = useContext(AppStoreContext); if (!store) { throw new Error('Cannot find app store!'); } return store; }