@finos/legend-application-marketplace
Version:
Legend Marketplace application core
31 lines • 2.07 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
/**
* Copyright (c) 2020-present, Goldman Sachs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { createContext, useContext } from 'react';
import { guaranteeNonNullable } from '@finos/legend-shared';
import { useLocalObservable } from 'mobx-react-lite';
import { ApplicationFrameworkProvider, BlockingAlert, useApplicationStore, NotificationManager, } from '@finos/legend-application';
import { LegendMarketplaceBaseStore, } from '../stores/LegendMarketplaceBaseStore.js';
export const useLegendMarketplaceApplicationStore = () => useApplicationStore();
const LegendMarketplaceBaseStoreContext = createContext(undefined);
const LegendMarketplaceBaseStoreProvider = ({ children }) => {
const applicationStore = useLegendMarketplaceApplicationStore();
const baseStore = useLocalObservable(() => new LegendMarketplaceBaseStore(applicationStore));
return (_jsx(LegendMarketplaceBaseStoreContext.Provider, { value: baseStore, children: children }));
};
export const useLegendMarketplaceBaseStore = () => guaranteeNonNullable(useContext(LegendMarketplaceBaseStoreContext), `Can't find Legend Marketplace base store in context`);
export const LegendMarketplaceFrameworkProvider = ({ children }) => (_jsxs(ApplicationFrameworkProvider, { simple: true, enableTransitions: true, children: [_jsx(BlockingAlert, {}), _jsx(NotificationManager, {}), _jsx(LegendMarketplaceBaseStoreProvider, { children: children })] }));
//# sourceMappingURL=LegendMarketplaceFrameworkProvider.js.map